Spaces:
Running
Running
Update graphql_calls.py
Browse files- graphql_calls.py +17 -14
graphql_calls.py
CHANGED
|
@@ -119,19 +119,22 @@ def get_commits(token, repository, branch, since):
|
|
| 119 |
|
| 120 |
commits = []
|
| 121 |
for node in nodes:
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
return commits
|
|
|
|
| 119 |
|
| 120 |
commits = []
|
| 121 |
for node in nodes:
|
| 122 |
+
try:
|
| 123 |
+
if node['author']['user'] is None:
|
| 124 |
+
commits.append(Commit(
|
| 125 |
+
message=node['message'].split('\n')[0],
|
| 126 |
+
user=User(name='<NOT FOUND>', organizations=[]),
|
| 127 |
+
additions=node.get('additions'),
|
| 128 |
+
deletions=node.get('deletions')
|
| 129 |
+
))
|
| 130 |
+
else:
|
| 131 |
+
commits.append(Commit(
|
| 132 |
+
message=node['message'].split('\n')[0],
|
| 133 |
+
user=User(name=node['author']['user']['login'], organizations=[n['name'] for n in node['author']['user']['organizations']['nodes']]),
|
| 134 |
+
additions=node.get('additions'),
|
| 135 |
+
deletions=node.get('deletions')
|
| 136 |
+
))
|
| 137 |
+
except TypeError:
|
| 138 |
+
print(f"Failed processing {node}")
|
| 139 |
|
| 140 |
return commits
|