Skip to content

Commit d884388

Browse files
committed
🔨 use login, the github user name as filter
1 parent 6ee766f commit d884388

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

moban_jinja2_github/contributors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def get_contributors(user, repo, exclude_contributors=()):
1010
user_list = [
1111
detail
1212
for detail in user_list
13-
if "name" in detail and detail["name"] not in exclude_contributors
13+
if "login" in detail and detail["login"] not in exclude_contributors
1414
]
1515
return user_list
1616
except UrlNotFound:

tests/test_contributors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
@patch("moban_jinja2_github.contributors.EndPoint")
77
def test_get_contributors(fake_end_point):
88
sample_contributors = [
9-
{"name": "author"},
10-
{"name": "ok", "url": "contributors"},
9+
{"login": "author"},
10+
{"login": "ok", "url": "contributors"},
1111
]
1212
fake_api = MagicMock(
1313
get_all_contributors=MagicMock(return_value=sample_contributors)
@@ -17,7 +17,7 @@ def test_get_contributors(fake_end_point):
1717
from moban_jinja2_github.contributors import get_contributors
1818

1919
actual = get_contributors("user", "repo", ["author"])
20-
expected = [{"name": "ok", "url": "contributors"}]
20+
expected = [{"login": "ok", "url": "contributors"}]
2121

2222
eq_(list(actual), expected)
2323

0 commit comments

Comments
 (0)