Add missing timezone info in important places

Things like SQLAlchemy work correctly only for timezone-aware datetimes.
The returned TLObjects all have them, but those that are manually created
were missing them, so serializing the state into SQLAlchemy sessions failed.
This commit is contained in:
Lonami Exo
2019-01-24 11:16:40 +01:00
parent 86a8928278
commit 10cd61d2f9
3 changed files with 10 additions and 6 deletions

View File

@@ -159,7 +159,7 @@ class Draft:
self._raw_text = raw_text
self.link_preview = link_preview
self.reply_to_msg_id = reply_to
self.date = datetime.datetime.now()
self.date = datetime.datetime.now(tz=datetime.timezone.utc)
return result