Skip to content

Commit

Permalink
Merge pull request #13 from ojacques/fix-7
Browse files Browse the repository at this point in the history
Fix #7: GitHub login is attempted before name
  • Loading branch information
ojacques authored Aug 27, 2022
2 parents 6d765f8 + 69e7adf commit cf0879f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions mkdocs_git_committers_plugin_2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ def get_git_info(self, path):
LOG.debug(" Found!")
author_id = c.author.email
else:
# If not found, search by name
LOG.debug(" User not found by email, search by name: " + c.author.name)
# If not found, search by name, expecting it to be GitHub user name
LOG.debug(" User not found yet, trying with GitHub username: " + c.author.name)
info = self.get_gituser_info( c.author.name, \
{ 'query': '{ search(type: USER, query: "in:name ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' })
{ 'query': '{ search(type: USER, query: "in:user ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' })
if info:
LOG.debug(" Found!")
author_id = c.author.name
else:
# If not found, search by name, expecting it to be GitHub user name
LOG.debug(" User not found yet, trying with GitHub username: " + c.author.name)
# If not found, search by name
LOG.debug(" User not found by email, search by name: " + c.author.name)
info = self.get_gituser_info( c.author.name, \
{ 'query': '{ search(type: USER, query: "in:user ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' })
{ 'query': '{ search(type: USER, query: "in:name ' + c.author.name + '", first: 1) { edges { node { ... on User { login name url } } } } }' })
if info:
LOG.debug(" Found!")
author_id = c.author.name
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='mkdocs-git-committers-plugin-2',
version='0.4.3',
version='0.4.4',
description='An MkDocs plugin to create a list of contributors on the page',
long_description='The git-committers plugin will seed the template context with a list of github committers and other useful GIT info such as last modified date',
keywords='mkdocs pdf github',
Expand Down

0 comments on commit cf0879f

Please sign in to comment.