From f563a0eb364b9350f7e2622166409ad8a6955ac6 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:55:22 +0100 Subject: [PATCH] providers/oauth2: fix migration (cherry-pick #12138) (#12140) providers/oauth2: fix migration (#12138) Signed-off-by: Jens Langhammer Co-authored-by: Jens L. --- .../0024_remove_oauth2provider_redirect_uris_and_more.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/providers/oauth2/migrations/0024_remove_oauth2provider_redirect_uris_and_more.py b/authentik/providers/oauth2/migrations/0024_remove_oauth2provider_redirect_uris_and_more.py index 0e88ba91c5..6f9dc199f0 100644 --- a/authentik/providers/oauth2/migrations/0024_remove_oauth2provider_redirect_uris_and_more.py +++ b/authentik/providers/oauth2/migrations/0024_remove_oauth2provider_redirect_uris_and_more.py @@ -1,4 +1,5 @@ # Generated by Django 5.0.9 on 2024-11-04 12:56 +from dataclasses import asdict from django.apps.registry import Apps from django.db.backends.base.schema import BaseDatabaseSchemaEditor @@ -18,8 +19,8 @@ def migrate_redirect_uris(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): mode = RedirectURIMatchingMode.STRICT if old == "*" or old == ".*": mode = RedirectURIMatchingMode.REGEX - uris.append(RedirectURI(mode, url=old)) - provider.redirect_uris = uris + uris.append(asdict(RedirectURI(mode, url=old))) + provider._redirect_uris = uris provider.save()