Skip to content

Commit 61a293d

Browse files
authored
core: bump django-rest-framework from 3.14.0 to 3.16.0 (#14057)
upgrade `django-rest-framework` to `3.16.0` The reverted commit is purely an optimization which unfortunately breaks authentik, specifically Blueprints. It adds `getattr(serializer.instance, field)` to a validator. If `field` is a `RelatedObject`, that invocation queries the database. When authentik creates objects using Blueprints, it doesn't place related objects into the database before the validator tries to get them from there, so with the reverted commit, it produces `RelatedObjectDoesNotExist`. Perhaps a long-term solution is to revise how Blueprints work, or perhaps it is to change upstream. But in the meantime, Django 5.0 support ended and upgrading to Django 5.1 requires an upgrade of `django-rest-framework` to `3.16.0`, hence this workaround. See - encode/django-rest-framework#9154 - encode/django-rest-framework#9358 - encode/django-rest-framework#9482 - encode/django-rest-framework#9483
1 parent edf3300 commit 61a293d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies = [
2424
"django-redis",
2525
"django-storages[s3]",
2626
"django-tenants",
27-
"djangorestframework ==3.14.0",
27+
"djangorestframework",
2828
"djangorestframework-guardian",
2929
"docker",
3030
"drf-orjson-renderer",
@@ -104,6 +104,7 @@ dev = [
104104
[tool.uv.sources]
105105
django-tenants = { git = "https://github.com/rissson/django-tenants.git", branch = "authentik-fixes" }
106106
opencontainers = { git = "https://github.com/BeryJu/oci-python", rev = "c791b19056769cd67957322806809ab70f5bead8" }
107+
djangorestframework = { git = "https://github.com/authentik-community/django-rest-framework", rev = "896722bab969fabc74a08b827da59409cf9f1a4e" }
107108

108109
[project.scripts]
109110
ak = "lifecycle.ak:main"

uv.lock

Lines changed: 3 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)