mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
update-authors-json: Improve error handling.
This commit is contained in:
parent
e5441af2c3
commit
c1f0ed5637
@ -71,12 +71,15 @@ def run_production():
|
||||
contribs = []
|
||||
for user in json_data:
|
||||
author = user.get('author')
|
||||
result_user = dict(
|
||||
avatar=author.get('avatar_url'),
|
||||
name=author.get('login'),
|
||||
commits=user.get('total')
|
||||
)
|
||||
contribs.append(result_user)
|
||||
try:
|
||||
result_user = dict(
|
||||
avatar=author.get('avatar_url'),
|
||||
name=author.get('login'),
|
||||
commits=user.get('total')
|
||||
)
|
||||
contribs.append(result_user)
|
||||
except AttributeError:
|
||||
print("Unable to access fields for %s" % (user,))
|
||||
|
||||
out_contrib_data = split_by(
|
||||
sorted(contribs, key=lambda k: k.get('commits'), reverse=True),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user