mypy: Annotate sent_time_in_epoch_seconds taking Optional[UserMessage].

This commit is contained in:
neiljp (Neil Pilgrim) 2017-08-08 16:48:33 -07:00 committed by Greg Price
parent 7aacda1883
commit 2d3b95a088
1 changed files with 2 additions and 3 deletions

View File

@ -59,9 +59,8 @@ def accounts_accept_terms(request):
)
def sent_time_in_epoch_seconds(user_message):
# type: (UserMessage) -> Optional[float]
# user_message is a UserMessage object.
if not user_message:
# type: (Optional[UserMessage]) -> Optional[float]
if user_message is None:
return None
# We have USE_TZ = True, so our datetime objects are timezone-aware.
# Return the epoch seconds in UTC.