Skip to content

Commit 7937902

Browse files
Update backend/apps/github/common.py by cr
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 05af907 commit 7937902

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

backend/apps/github/common.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ def sync_issue(issue_link):
8282
except User.DoesNotExist:
8383
repo_owner = User.update_data(gh_repo.owner)
8484
try:
85-
organization = Organization.objects.get(node_id=gh_repo.organization.id)
86-
except Organization.DoesNotExist:
87-
organization = Organization.update_data(gh_repo.organization)
85+
if gh_repo.organization:
86+
try:
87+
organization = Organization.objects.get(node_id=gh_repo.organization.id)
88+
except Organization.DoesNotExist:
89+
organization = Organization.update_data(gh_repo.organization)
90+
else:
91+
organization = None
8892

8993
repository = Repository.update_data(
9094
gh_repository=gh_repo,

0 commit comments

Comments
 (0)