From 4f77724ac236cef3f4fb346fef6e37afa2623caa Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Wed, 21 Sep 2022 11:40:27 +0200 Subject: [PATCH 04/10] auth_saml: switch related object foreign key to base model (#53442) --- .../0011_alter_authenticator_foreign_key.py | 41 +++++++++++++++++++ src/authentic2_auth_saml/models.py | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/authentic2_auth_saml/migrations/0011_alter_authenticator_foreign_key.py diff --git a/src/authentic2_auth_saml/migrations/0011_alter_authenticator_foreign_key.py b/src/authentic2_auth_saml/migrations/0011_alter_authenticator_foreign_key.py new file mode 100644 index 000000000..c75d0f9c6 --- /dev/null +++ b/src/authentic2_auth_saml/migrations/0011_alter_authenticator_foreign_key.py @@ -0,0 +1,41 @@ +# Generated by Django 2.2.26 on 2022-09-20 14:48 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentic2_auth_saml', '0010_delete_renameattributeaction'), + ] + + operations = [ + migrations.AlterField( + model_name='addroleaction', + name='authenticator', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='add_role_actions', + to='authenticators.BaseAuthenticator', + ), + ), + migrations.AlterField( + model_name='samlattributelookup', + name='authenticator', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='attribute_lookups', + to='authenticators.BaseAuthenticator', + ), + ), + migrations.AlterField( + model_name='setattributeaction', + name='authenticator', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='set_attribute_actions', + to='authenticators.BaseAuthenticator', + ), + ), + ] diff --git a/src/authentic2_auth_saml/models.py b/src/authentic2_auth_saml/models.py index 592b2cc3a..7121c0b6c 100644 --- a/src/authentic2_auth_saml/models.py +++ b/src/authentic2_auth_saml/models.py @@ -214,7 +214,7 @@ class SAMLAuthenticator(BaseAuthenticator): class AuthenticatorRelatedObjectBase(models.Model): - authenticator = models.ForeignKey(SAMLAuthenticator, on_delete=models.CASCADE) + authenticator = models.ForeignKey(BaseAuthenticator, on_delete=models.CASCADE) class Meta: abstract = True -- 2.30.2