Skip to content

Commit 17eb782

Browse files
authored
Merge pull request #11676 from Ostap-Zherebetskyi/hotfix/email_throttle
[ENG-10738] Registration creation failed due to missing null check during throttle check
2 parents ee6b35f + 396b44e commit 17eb782

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

website/project/views/contributor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,10 @@ def check_email_throttle(
591591
if not subscription:
592592
return False # No subscription means no previous notifications, so no throttling
593593
# Check the most recent Notification for this subscription
594-
return subscription.notifications.order_by('created').first().created > timezone.now() - timedelta(seconds=throttle)
594+
notification = subscription.notifications.order_by('created').first()
595+
if not notification:
596+
return False # No notification found for the subscription, thus no throttling
597+
return notification.created > timezone.now() - timedelta(seconds=throttle)
595598

596599

597600
@contributor_added.connect

0 commit comments

Comments
 (0)