added email_sent field to student model, do not send mail twice if not needed
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user