Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #72: UnboundLocalError user variable fix for github and gitlab #73

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mkdocs_git_committers_plugin_2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def get_contributors_to_file(self, path, submodule_repo=None):
authors.append({'login': commit['author']['login'],
'name': commit['author']['login'],
'url': commit['author']['html_url'],
'avatar': commit['author']['avatar_url'] if user['avatar_url'] is not None else ''
'avatar': commit['author']['avatar_url'] if commit['author']['avatar_url'] is not None else ''
})
if commit['committer'] and commit['committer']['login'] and commit['committer']['login'] not in [author['login'] for author in authors]:
authors.append({'login': commit['committer']['login'],
'name': commit['committer']['login'],
'url': commit['committer']['html_url'],
'avatar': commit['committer']['avatar_url'] if user['avatar_url'] is not None else ''
'avatar': commit['committer']['avatar_url'] if commit['author']['avatar_url'] is not None else ''
onuralpszr marked this conversation as resolved.
Show resolved Hide resolved
})
if commit['commit'] and commit['commit']['message'] and '\nCo-authored-by:' in commit['commit']['message']:
github_coauthors_exist = True
Expand All @@ -138,7 +138,7 @@ def get_contributors_to_file(self, path, submodule_repo=None):
authors.append({'login': self.gitlabauthors_cache[commit['author_name']]['username'],
'name': commit['author_name'],
'url': self.gitlabauthors_cache[commit['author_name']]['web_url'],
'avatar': self.gitlabauthors_cache[commit['author_name']]['avatar_url'] if user['avatar_url'] is not None else ''
'avatar': self.gitlabauthors_cache[commit['author_name']]['avatar_url'] if self.gitlabauthors_cache[commit['author_name']]['avatar_url'] is not None else ''
})
else:
# Fetch author from GitLab API
Expand Down