Actually use our tz-aware datetime object when changing awareness

(imported from commit e0f85534fa12a712dd8c61b66abd687d36ba9088)
This commit is contained in:
Leo Franchi 2013-07-22 10:52:37 -04:00
parent 5a56e7cd29
commit 8b90d4bb8a
1 changed files with 2 additions and 2 deletions

View File

@ -1332,8 +1332,8 @@ def handle_missedmessage_emails(user_profile_id, missed_email_events):
last_reminder = last_reminder.replace(tzinfo=utc)
waitperiod = datetime.timedelta(hours=UserProfile.EMAIL_REMINDER_WAITPERIOD)
if len(messages) == 0 or (user_profile.last_reminder and \
timestamp - user_profile.last_reminder < waitperiod):
if len(messages) == 0 or (last_reminder and \
timestamp - last_reminder < waitperiod):
# Don't spam the user, if we've sent an email in the last day
return