You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In model AccountTransaction as creation_timestamp we using fernet_fields.EncryptedDateTimeField. And we just found that this field is loosing timezone on save action.
Please see below code:
In [22]: at_z3=AccountTransaction.objects.last()
In [22]: at_z3.creation_timestampOut[22]: datetime.datetime(2021, 10, 29, 3, 16, 6, 896068)
In [23]: at_z3.creation_timestamp=set_timezone(at_z3.creation_timestamp)
In [24]: at_z3.creation_timestampOut[24]: datetime.datetime(2021, 10, 29, 3, 16, 6, 896068, tzinfo=<DstTzInfo'Europe/Berlin'CEST+2:00:00DST>)
In [25]: at_z3.save()
In [26]: at_z4=AccountTransaction.objects.last()
In [27]: at_z3Out[27]: <AccountTransaction: f2d60076-ff91-4d98-8f63-7b2e896635e6-T613951385360465921.48974>In [28]: at_z4Out[28]: <AccountTransaction: f2d60076-ff91-4d98-8f63-7b2e896635e6-T613951385360465921.48974>In [29]: at_z3.creation_timestampOut[29]: datetime.datetime(2021, 10, 29, 3, 16, 6, 896068, tzinfo=<DstTzInfo'Europe/Berlin'CEST+2:00:00DST>)
In [30]: at_z4.creation_timestampOut[30]: datetime.datetime(2021, 10, 29, 1, 16, 6, 896068)
The text was updated successfully, but these errors were encountered:
In model
AccountTransaction
ascreation_timestamp
we usingfernet_fields.EncryptedDateTimeField
. And we just found that this field is loosing timezone onsave
action.Please see below code:
The text was updated successfully, but these errors were encountered: