Skip to content

Commit 876d9fa

Browse files
authored
Merge pull request #73 from onuralpszr/fix/issue72
fix: UnboundLocalError user variable fix for github and gitlab
2 parents 33d54e6 + 13a4a2f commit 876d9fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mkdocs_git_committers_plugin_2/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ def get_contributors_to_file(self, path, submodule_repo=None):
118118
authors.append({'login': commit['author']['login'],
119119
'name': commit['author']['login'],
120120
'url': commit['author']['html_url'],
121-
'avatar': commit['author']['avatar_url'] if user['avatar_url'] is not None else ''
121+
'avatar': commit['author']['avatar_url'] if commit['author']['avatar_url'] is not None else ''
122122
})
123123
if commit['committer'] and commit['committer']['login'] and commit['committer']['login'] not in [author['login'] for author in authors]:
124124
authors.append({'login': commit['committer']['login'],
125125
'name': commit['committer']['login'],
126126
'url': commit['committer']['html_url'],
127-
'avatar': commit['committer']['avatar_url'] if user['avatar_url'] is not None else ''
127+
'avatar': commit['committer']['avatar_url'] if commit['committer']['avatar_url'] is not None else ''
128128
})
129129
if commit['commit'] and commit['commit']['message'] and '\nCo-authored-by:' in commit['commit']['message']:
130130
github_coauthors_exist = True
@@ -138,7 +138,7 @@ def get_contributors_to_file(self, path, submodule_repo=None):
138138
authors.append({'login': self.gitlabauthors_cache[commit['author_name']]['username'],
139139
'name': commit['author_name'],
140140
'url': self.gitlabauthors_cache[commit['author_name']]['web_url'],
141-
'avatar': self.gitlabauthors_cache[commit['author_name']]['avatar_url'] if user['avatar_url'] is not None else ''
141+
'avatar': self.gitlabauthors_cache[commit['author_name']]['avatar_url'] if self.gitlabauthors_cache[commit['author_name']]['avatar_url'] is not None else ''
142142
})
143143
else:
144144
# Fetch author from GitLab API

0 commit comments

Comments
 (0)