diff --git a/aleksis/apps/alsijil/migrations/0016_add_not_counted_excuse_types.py b/aleksis/apps/alsijil/migrations/0016_add_not_counted_excuse_types.py new file mode 100644 index 0000000000000000000000000000000000000000..48b38b7c9eae6838ff4108628beeb3234e0edada --- /dev/null +++ b/aleksis/apps/alsijil/migrations/0016_add_not_counted_excuse_types.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-03-20 10:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('alsijil', '0015_fix_unique_personal_note'), + ] + + operations = [ + migrations.AddField( + model_name='excusetype', + name='count_as_missed_lesson', + field=models.BooleanField(default=True, help_text="If checked, this excuse type will be counted as missed lesson. If not checked, it won't show up in the absence report.", verbose_name='Count as missed lesson'), + ), + ] diff --git a/aleksis/apps/alsijil/models.py b/aleksis/apps/alsijil/models.py index 1805831a1b25cbe01744f9a3a7e7a2baf7f27966..6f64875b5da988be07051b765d5fa306743b8e96 100644 --- a/aleksis/apps/alsijil/models.py +++ b/aleksis/apps/alsijil/models.py @@ -50,6 +50,13 @@ class ExcuseType(ExtensibleModel): short_name = models.CharField(max_length=255, unique=True, verbose_name=_("Short name")) name = models.CharField(max_length=255, unique=True, verbose_name=_("Name")) + count_as_missed_lesson = models.BooleanField( + default=True, + verbose_name=_("Count as missed lesson"), + help_text=_("If checked, this excuse type will be counted as missed lesson. If not checked, it won't show up " + "in the absence report."), + ) + def __str__(self): return f"{self.name} ({self.short_name})"