mirror of https://github.com/zulip/zulip.git
zerver/models.py: Fix last_reminder_tzaware annotation.
Fix annotated return type of UserProfile.last_reminder_tzaware from `str` to `Optional[datetime.datetime]`.
This commit is contained in:
parent
8acc51218e
commit
0cc7a6583c
|
@ -456,10 +456,10 @@ class UserProfile(AbstractBaseUser, PermissionsMixin):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def last_reminder_tzaware(self):
|
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):
|
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"
|
logging.warning(u"Loaded a user_profile.last_reminder for user %s that's not tz-aware: %s"
|
||||||
% (self.email, self.last_reminder))
|
% (self.email, text_type(self.last_reminder)))
|
||||||
return self.last_reminder.replace(tzinfo=timezone.utc)
|
return self.last_reminder.replace(tzinfo=timezone.utc)
|
||||||
|
|
||||||
return self.last_reminder
|
return self.last_reminder
|
||||||
|
|
Loading…
Reference in New Issue