agdsn / hades

AG DSN Authentication and Authorization Infrastructure
MIT License
8 stars 3 forks source link

Standardize tzinfo type in tasks' return values #64

Closed lukasjuhrich closed 7 years ago

lukasjuhrich commented 7 years ago

Remotely triggering a celery task (i.e. get_auth_attempts_at_port) that fetches a datetime-Type from the postgres database implicitly introduces a dependency on psycopg2, because a custom tzinfo type has to be serialized and unserialized. Even if it is installed, it may not be a vastly different version. This cannot be the case, especially if the client depends on psycopg2 itself.

In [20]: logs[-1][3]
Out[20]: datetime.datetime(2017, 7, 31, 21, 58, 42, 588854, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name=None))