mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 15:31:08 +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:
|
def from_data(cls: type[Item], *args) -> Item:
|
||||||
data = cls(*args)
|
data = cls(*args)
|
||||||
data.value = deserialize_value(data.value, data.value_type)
|
data.value = deserialize_value(data.value, data.value_type)
|
||||||
|
|
||||||
|
if not isinstance(data.updated, datetime):
|
||||||
data.updated = datetime.fromtimestamp(data.updated, tz = timezone.utc)
|
data.updated = datetime.fromtimestamp(data.updated, tz = timezone.utc)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue