From ab1f4a353fea0dd3a18d0582c7e58180a5635bfc Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Fri, 26 Feb 2021 18:46:03 +0100 Subject: [PATCH] Force tardiness to be positive Closes #141 --- .../migrations/0011_tardiness_positive.py | 18 ++++++++++++++++++ aleksis/apps/alsijil/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 aleksis/apps/alsijil/migrations/0011_tardiness_positive.py diff --git a/aleksis/apps/alsijil/migrations/0011_tardiness_positive.py b/aleksis/apps/alsijil/migrations/0011_tardiness_positive.py new file mode 100644 index 000000000..8d9afa8e0 --- /dev/null +++ b/aleksis/apps/alsijil/migrations/0011_tardiness_positive.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.6 on 2021-02-26 17:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('alsijil', '0010_events_extra_lessons'), + ] + + operations = [ + migrations.AlterField( + model_name='personalnote', + name='late', + field=models.PositiveSmallIntegerField(default=0), + ), + ] diff --git a/aleksis/apps/alsijil/models.py b/aleksis/apps/alsijil/models.py index 163ef2b86..f8146cd79 100644 --- a/aleksis/apps/alsijil/models.py +++ b/aleksis/apps/alsijil/models.py @@ -193,7 +193,7 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel): ) absent = models.BooleanField(default=False) - late = models.IntegerField(default=0) + late = models.PositiveSmallIntegerField(default=0) excused = models.BooleanField(default=False) excuse_type = models.ForeignKey( ExcuseType, on_delete=models.SET_NULL, null=True, blank=True, verbose_name=_("Excuse type"), -- GitLab