Max 4 digits for user password

This commit is contained in:
2025-11-27 12:56:46 +01:00
parent cc833c475f
commit 1c0b287666

View File

@@ -46,8 +46,8 @@ class Student(models.Model):
blank=True
)
def default_password(self) -> str:
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id}"
def default_password(self) -> str: # Maximum 4 digits for passowrd
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id % 10000}"
def default_username(self) -> str:
if self.pk and self.user: