Max 4 digits for user password
This commit is contained in:
@@ -46,8 +46,8 @@ class Student(models.Model):
|
|||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
|
||||||
def default_password(self) -> str:
|
def default_password(self) -> str: # Maximum 4 digits for passowrd
|
||||||
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id}"
|
return f"{self.name.lower()[0]}{self.surname.lower()}{self.id % 10000}"
|
||||||
|
|
||||||
def default_username(self) -> str:
|
def default_username(self) -> str:
|
||||||
if self.pk and self.user:
|
if self.pk and self.user:
|
||||||
|
|||||||
Reference in New Issue
Block a user