Files
João C. Fernandes 86e9798f5e packages/django-postgres-cache: fix naive datetime warning (#23033)
* packages/django-postgres-cache: fix naive datetime warning when timeout=None with USE_TZ=True

The _base_set_expiry method in DatabaseCache returned datetime.max (a
timezone-naive value) when timeout=None, while the project runs with
USE_TZ=True.

This caused Django to emit a RuntimeWarning on every cache write that
 passes timeout=None:

    DateTimeField CacheEntry.expires received a naive datetime (...)
    while time zone support is active.

* fix linting

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
2026-06-21 20:09:09 +00:00
..
2026-01-15 02:08:17 +01:00

django-postgres-cache

Use in migrations

Migrations that use the cache with this installed need to depend on the migration to create the cache entry table:

    dependencies = [
        # ...other requirements
        ("django_postgres_cache", "0001_initial"),
    ]