From b759c53e750877e15c7ae0b2b337052e87d3608f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 20 Nov 2024 10:52:22 +0100 Subject: [PATCH] add memberFederated model --- ...03_memberfederated_institution_and_more.py | 60 +++++++++++++++++++ dpp/models.py | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 dpp/migrations/0003_memberfederated_institution_and_more.py diff --git a/dpp/migrations/0003_memberfederated_institution_and_more.py b/dpp/migrations/0003_memberfederated_institution_and_more.py new file mode 100644 index 0000000..2024798 --- /dev/null +++ b/dpp/migrations/0003_memberfederated_institution_and_more.py @@ -0,0 +1,60 @@ +# Generated by Django 5.0.6 on 2024-11-20 10:51 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("dpp", "0002_memberfederated"), + ("user", "0001_initial"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AddField( + model_name="memberfederated", + name="institution", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="user.institution", + ), + ), + migrations.AlterField( + model_name="memberfederated", + name="client_id", + field=models.CharField(max_length=256, null=True), + ), + migrations.AlterField( + model_name="memberfederated", + name="client_secret", + field=models.CharField(max_length=256, null=True), + ), + migrations.CreateModel( + name="UserDpp", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("roles_dlt", models.TextField()), + ("api_keys_dlt", models.TextField()), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + ] diff --git a/dpp/models.py b/dpp/models.py index dc0eb8c..6bcaccd 100644 --- a/dpp/models.py +++ b/dpp/models.py @@ -20,7 +20,7 @@ class MemberFederated(models.Model): domain = models.CharField(max_length=STR_EXTEND_SIZE) # This client_id and client_secret is used for connected to this domain as # a client and this domain then is the server of auth - client_id = models.CharField(max_length=STR_EXTEND_SIZE. null=True) + client_id = models.CharField(max_length=STR_EXTEND_SIZE, null=True) client_secret = models.CharField(max_length=STR_EXTEND_SIZE, null=True) institution = models.ForeignKey( Institution, on_delete=models.SET_NULL, null=True, blank=True)