added email_sent field to student model, do not send mail twice if not needed

This commit is contained in:
2025-12-10 11:43:04 +01:00
parent 99d24583d6
commit da8c8db0d2
4 changed files with 41 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ class Student(models.Model):
phone = modelfields.PhoneNumberField(
null=True,
db_index=True,
unique=True
)
@@ -54,6 +55,11 @@ class Student(models.Model):
Aircraft
)
mail_sent = models.BooleanField(
null=False,
default=False
)
def default_password(self) -> str: # Maximum 4 digits for passowrd
if self.pk:
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id % 10000}"