for commit in commits try nc NotifiedCommit objects get repo repo comm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
for commit in commits:
try:
nc = NotifiedCommit.objects.get(repo=repo,
commit=commit.id)
except NotifiedCommit.DoesNotExist:
nc = NotifiedCommit.objects.create(repo=repo,
commit=commit.id)
else:
continue
self.send_notification(profiles, repo, commit)