mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 19:42:29 +00:00
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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user