diff --git a/idhub/migrations/0002_schemas_template_description_alter_did_label_and_more.py b/idhub/migrations/0002_schemas_template_description_alter_did_label_and_more.py new file mode 100644 index 0000000..866e23c --- /dev/null +++ b/idhub/migrations/0002_schemas_template_description_alter_did_label_and_more.py @@ -0,0 +1,82 @@ +# Generated by Django 4.2.5 on 2023-12-19 17:27 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + ('idhub', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='schemas', + name='template_description', + field=models.TextField(null=True), + ), + migrations.AlterField( + model_name='did', + name='label', + field=models.CharField(max_length=50, verbose_name='Label'), + ), + migrations.AlterField( + model_name='event', + name='created', + field=models.DateTimeField(auto_now=True, verbose_name='Date'), + ), + migrations.AlterField( + model_name='event', + name='message', + field=models.CharField(max_length=350, verbose_name='Description'), + ), + migrations.AlterField( + model_name='event', + name='type', + field=models.PositiveSmallIntegerField( + choices=[ + (1, 'User registered'), + (2, 'User welcomed'), + (3, 'Data update requested by user'), + (4, 'Data update requested. Pending approval by administrator'), + (5, "User's data updated by admin"), + (6, 'Your data updated by admin'), + (7, 'User deactivated by admin'), + (8, 'DID created by user'), + (9, 'DID created'), + (10, 'DID deleted'), + (11, 'Credential deleted by user'), + (12, 'Credential deleted'), + (13, 'Credential issued for user'), + (14, 'Credential issued'), + (15, 'Credential presented by user'), + (16, 'Credential presented'), + (17, 'Credential enabled'), + (18, 'Credential available'), + (19, 'Credential revoked by admin'), + (20, 'Credential revoked'), + (21, 'Role created by admin'), + (22, 'Role modified by admin'), + (23, 'Role deleted by admin'), + (24, 'Service created by admin'), + (25, 'Service modified by admin'), + (26, 'Service deleted by admin'), + (27, 'Organisational DID created by admin'), + (28, 'Organisational DID deleted by admin'), + (29, 'User deactivated'), + (30, 'User activated'), + ], + verbose_name='Event', + ), + ), + migrations.AlterField( + model_name='userrol', + name='service', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='users', + to='idhub.service', + verbose_name='Service', + ), + ), + ] diff --git a/idhub/migrations/0002_verificablecredential_description.py b/idhub/migrations/0002_verificablecredential_description.py deleted file mode 100644 index 21bd095..0000000 --- a/idhub/migrations/0002_verificablecredential_description.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.2.5 on 2023-12-09 16:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('idhub', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='verificablecredential', - name='description', - field=models.TextField(null=True), - ), - ] diff --git a/idhub/models.py b/idhub/models.py index 1f23b15..df9b76b 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -438,7 +438,7 @@ class Schemas(models.Model): created_at = models.DateTimeField(auto_now=True) _name = models.CharField(max_length=250, null=True, db_column='name') _description = models.CharField(max_length=250, null=True, db_column='description') - template_description = models.TextField() + template_description = models.TextField(null=True) @property def get_schema(self): diff --git a/idhub/user/forms.py b/idhub/user/forms.py index f39b102..07b134d 100644 --- a/idhub/user/forms.py +++ b/idhub/user/forms.py @@ -1,13 +1,10 @@ -import requests from django import forms from django.conf import settings from django.utils.translation import gettext_lazy as _ -from idhub.models import DID, VerificableCredential, Organization - -from idhub_auth.models import User from idhub.models import DID, VerificableCredential from oidc4vp.models import Organization + class RequestCredentialForm(forms.Form): did = forms.ChoiceField(label=_("Did"), choices=[]) credential = forms.ChoiceField(label=_("Credential"), choices=[]) diff --git a/idhub/user/views.py b/idhub/user/views.py index 7b0f44c..07430f5 100644 --- a/idhub/user/views.py +++ b/idhub/user/views.py @@ -22,7 +22,7 @@ from idhub.user.tables import ( ) from idhub.user.forms import ( RequestCredentialForm, - CredentialPresentationForm + DemandAuthorizationForm ) from idhub.mixins import UserView from idhub.models import DID, VerificableCredential, Event, Membership