From b182c86a622d10853931277b7ec5a8b5e8ed8f79 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 24 Nov 2023 18:10:43 +0100 Subject: [PATCH] fix nullable field --- oidc4vp/migrations/0001_initial.py | 4 ++-- oidc4vp/models.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/oidc4vp/migrations/0001_initial.py b/oidc4vp/migrations/0001_initial.py index cc0d8fd..c88d0f8 100644 --- a/oidc4vp/migrations/0001_initial.py +++ b/oidc4vp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.5 on 2023-11-24 16:53 +# Generated by Django 4.2.5 on 2023-11-24 17:10 from django.conf import settings from django.db import migrations, models @@ -50,7 +50,7 @@ class Migration(migrations.Migration): ( 'client_id', models.CharField( - default=oidc4vp.models.set_client_id, max_length=24 + default=oidc4vp.models.set_client_id, max_length=24, unique=True ), ), ( diff --git a/oidc4vp/models.py b/oidc4vp/models.py index fa273b7..e26464a 100644 --- a/oidc4vp/models.py +++ b/oidc4vp/models.py @@ -36,8 +36,15 @@ class Organization(models.Model): This class represent a member of one net trust or federated host """ name = models.CharField(max_length=250) - client_id = models.CharField(max_length=24, default=set_client_id) - client_secret = models.CharField(max_length=48, default=set_client_secret) + client_id = models.CharField( + max_length=24, + default=set_client_id, + unique=True + ) + client_secret = models.CharField( + max_length=48, + default=set_client_secret + ) response_uri = models.URLField( help_text=_("Url where to send the verificable presentation"), max_length=250