Reset our 24hr email blackout when a user logs in

(imported from commit 93bed7c4d049ba4d7b30d2e02fbbe0d2debca6f8)
This commit is contained in:
Leo Franchi
2013-05-17 15:28:51 -04:00
committed by Tim Abbott
parent e5b1e16885
commit 81058f5f9b
3 changed files with 12 additions and 2 deletions

View File

@@ -1215,8 +1215,9 @@ def handle_missedmessage_emails(user_profile_id, missed_email_events):
message__id__in=message_ids,
flags=~UserMessage.flags.read)]
if len(messages) == 0 or (user_profile.last_reminder and
timestamp - user_profile.last_reminder < datetime.timedelta(days=1)):
waitperiod = datetime.timedelta(hours=UserProfile.EMAIL_REMINDER_WAITPERIOD)
if len(messages) == 0 or (user_profile.last_reminder and \
timestamp - user_profile.last_reminder < waitperiod):
# Don't spam the user, if we've sent an email in the last day
return