From 4a9b78870302a9929278bc4c7cd76df0342277a8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 24 May 2022 21:57:03 +0200 Subject: [PATCH] providers/oauth2: set related_name for many-to-many so used by detects the connection Signed-off-by: Jens Langhammer --- .../migrations/0011_oauth2provider_jwks_sources_and_more.py | 4 ++-- authentik/providers/oauth2/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/authentik/providers/oauth2/migrations/0011_oauth2provider_jwks_sources_and_more.py b/authentik/providers/oauth2/migrations/0011_oauth2provider_jwks_sources_and_more.py index c1245df67..02af91b82 100644 --- a/authentik/providers/oauth2/migrations/0011_oauth2provider_jwks_sources_and_more.py +++ b/authentik/providers/oauth2/migrations/0011_oauth2provider_jwks_sources_and_more.py @@ -21,7 +21,7 @@ class Migration(migrations.Migration): field=models.ManyToManyField( blank=True, default=None, - related_name="+", + related_name="oauth2_providers", to="authentik_sources_oauth.oauthsource", verbose_name="Any JWT signed by the JWK of the selected source can be used to authenticate.", ), @@ -33,7 +33,7 @@ class Migration(migrations.Migration): blank=True, default=None, help_text="DEPRECATED. JWTs created with the configured certificates can authenticate with this provider.", - related_name="+", + related_name="oauth2_providers", to="authentik_crypto.certificatekeypair", verbose_name="Allowed certificates for JWT-based client_credentials", ), diff --git a/authentik/providers/oauth2/models.py b/authentik/providers/oauth2/models.py index 8ceea8e1d..b84c7301e 100644 --- a/authentik/providers/oauth2/models.py +++ b/authentik/providers/oauth2/models.py @@ -231,7 +231,7 @@ class OAuth2Provider(Provider): "certificates can authenticate with this provider." ) ), - related_name="+", + related_name="oauth2_providers", default=None, blank=True, ) @@ -240,7 +240,7 @@ class OAuth2Provider(Provider): verbose_name=_( "Any JWT signed by the JWK of the selected source can be used to authenticate." ), - related_name="+", + related_name="oauth2_providers", default=None, blank=True, )