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

Add max_days to RoleType

Introduced to limit the max duration a Role can be assigned
parent 0fe9d23b
No related branches found
No related tags found
1 merge request!114Greg 83 modify roles
# Generated by Django 3.2.7 on 2021-10-19 07:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('greg', '0009_email_mobile_to_identity'),
]
operations = [
migrations.AddField(
model_name='roletype',
name='max_days',
field=models.IntegerField(default=365),
),
]
...@@ -180,6 +180,8 @@ class RoleType(BaseModel): ...@@ -180,6 +180,8 @@ class RoleType(BaseModel):
description_nb = models.TextField() description_nb = models.TextField()
description_en = models.TextField() description_en = models.TextField()
default_duration_days = models.IntegerField(null=True) default_duration_days = models.IntegerField(null=True)
# Max days into the future this role can be assigned
max_days = models.IntegerField(default=365)
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