mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
make sure Item.updated is a datetime object if it isn't one already
This commit is contained in:
parent
3d81e5ef68
commit
46413be2af
|
@ -69,7 +69,10 @@ class Item:
|
|||
def from_data(cls: type[Item], *args) -> Item:
|
||||
data = cls(*args)
|
||||
data.value = deserialize_value(data.value, data.value_type)
|
||||
data.updated = datetime.fromtimestamp(data.updated, tz = timezone.utc)
|
||||
|
||||
if not isinstance(data.updated, datetime):
|
||||
data.updated = datetime.fromtimestamp(data.updated, tz = timezone.utc)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue