Improve time-related stuff
All checks were successful
continuous-integration/drone/push Build is passing

Add created_at to all models
Add modified_at to Session
Get rid of custom now() function
Make sure aware datetime is used everywhere
This commit is contained in:
2023-11-15 17:47:51 +01:00
parent 3f037b4c7c
commit c44d8bf427
5 changed files with 127 additions and 39 deletions

View File

@ -1,12 +1,5 @@
import re
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
from django.conf import settings
def now() -> datetime:
return datetime.now(ZoneInfo(settings.TIME_ZONE))
from datetime import timedelta
def _safe_timedelta(duration: timedelta | int | None):