providers/proxy: fix defaults for old proxy providers (load providers directly)

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-09 13:54:24 +02:00
parent d98499a3fa
commit da58796768
1 changed files with 1 additions and 2 deletions

View File

@ -6,10 +6,9 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor
def migrate_defaults(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): def migrate_defaults(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
from authentik.providers.proxy.models import JWTAlgorithms from authentik.providers.proxy.models import JWTAlgorithms, ProxyProvider
db_alias = schema_editor.connection.alias db_alias = schema_editor.connection.alias
ProxyProvider = apps.get_model("authentik_providers_proxy", "proxyprovider")
for provider in ProxyProvider.objects.using(db_alias).filter(jwt_alg=JWTAlgorithms.RS256): for provider in ProxyProvider.objects.using(db_alias).filter(jwt_alg=JWTAlgorithms.RS256):
provider.set_oauth_defaults() provider.set_oauth_defaults()
provider.save() provider.save()