From 0cc7a6583ce75152d6b624dd800ed2dcabe5d12b Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Sun, 12 Jun 2016 15:33:05 +0530 Subject: [PATCH] zerver/models.py: Fix last_reminder_tzaware annotation. Fix annotated return type of UserProfile.last_reminder_tzaware from `str` to `Optional[datetime.datetime]`. --- zerver/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/models.py b/zerver/models.py index b442ce4542..c3b21035a5 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -456,10 +456,10 @@ class UserProfile(AbstractBaseUser, PermissionsMixin): return False def last_reminder_tzaware(self): - # type: () -> str + # type: () -> Optional[datetime.datetime] if self.last_reminder is not None and timezone.is_naive(self.last_reminder): - logging.warning("Loaded a user_profile.last_reminder for user %s that's not tz-aware: %s" - % (self.email, self.last_reminder)) + logging.warning(u"Loaded a user_profile.last_reminder for user %s that's not tz-aware: %s" + % (self.email, text_type(self.last_reminder))) return self.last_reminder.replace(tzinfo=timezone.utc) return self.last_reminder