[schema] Make last_reminder field nullable

(imported from commit e7d14c222d64ac317fc96d0c6bb17220aa6ba097)
This commit is contained in:
Leo Franchi
2013-05-23 14:33:57 -04:00
committed by Tim Abbott
parent 1a0eefdaa5
commit e5b1e16885
3 changed files with 156 additions and 2 deletions

View File

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