Store datetime as naive UTC datetimes (no TZ info) in db, to avoid issues with SQLite

This commit is contained in:
Lucas Verney 2018-08-02 11:19:44 +02:00
parent 343143e8e7
commit f83f66a353

View File

@ -41,7 +41,7 @@ class Report(BaseModel):
lat = peewee.DoubleField() lat = peewee.DoubleField()
lng = peewee.DoubleField() lng = peewee.DoubleField()
datetime = peewee.DateTimeField( datetime = peewee.DateTimeField(
default=lambda: arrow.utcnow().replace(microsecond=0).datetime default=lambda: arrow.utcnow().replace(microsecond=0).naive
) )
expiration_datetime = peewee.DateTimeField(null=True) expiration_datetime = peewee.DateTimeField(null=True)
is_open = peewee.BooleanField(default=True) is_open = peewee.BooleanField(default=True)