We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ee6b35f + 396b44e commit 17eb782Copy full SHA for 17eb782
1 file changed
website/project/views/contributor.py
@@ -591,7 +591,10 @@ def check_email_throttle(
591
if not subscription:
592
return False # No subscription means no previous notifications, so no throttling
593
# Check the most recent Notification for this subscription
594
- return subscription.notifications.order_by('created').first().created > timezone.now() - timedelta(seconds=throttle)
+ 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)
598
599
600
@contributor_added.connect
0 commit comments