Skip to content
Snippets Groups Projects
Commit c19bca52 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Add mandatory field to ConsentType

parent 7d8a7d50
No related branches found
No related tags found
1 merge request!43Feature/hasconsented
...@@ -79,7 +79,13 @@ class ConsentAdmin(VersionAdmin): ...@@ -79,7 +79,13 @@ class ConsentAdmin(VersionAdmin):
class ConsentTypeAdmin(admin.ModelAdmin): class ConsentTypeAdmin(admin.ModelAdmin):
list_display = ("id", "name_en", "valid_from", "user_allowed_to_change") list_display = (
"id",
"name_en",
"valid_from",
"user_allowed_to_change",
"mandatory",
)
readonly_fields = ("id", "created", "updated") readonly_fields = ("id", "created", "updated")
......
# Generated by Django 3.2.7 on 2021-09-03 10:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('greg', '0002_identity'),
]
operations = [
migrations.AddField(
model_name='consenttype',
name='mandatory',
field=models.BooleanField(default=False),
),
]
...@@ -247,6 +247,7 @@ class ConsentType(BaseModel): ...@@ -247,6 +247,7 @@ class ConsentType(BaseModel):
link_nb = models.URLField(null=True) link_nb = models.URLField(null=True)
valid_from = models.DateField(default=date.today) valid_from = models.DateField(default=date.today)
user_allowed_to_change = models.BooleanField() user_allowed_to_change = models.BooleanField()
mandatory = models.BooleanField(default=False)
def __str__(self): def __str__(self):
return "{} ({})".format(str(self.name_en or self.name_nb), self.identifier) return "{} ({})".format(str(self.name_en or self.name_nb), self.identifier)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment