feat: add new member

This commit is contained in:
Jannat Patel
2024-08-19 11:47:17 +05:30
parent 75f0e5b9f1
commit cdd46667f3
5 changed files with 212 additions and 134 deletions

View File

@@ -16,6 +16,9 @@ class CustomUser(User):
super().validate()
self.validate_username_duplicates()
def after_insert(self):
self.add_roles("LMS Student")
def validate_username_duplicates(self):
while not self.username or self.username_exists():
self.username = append_number_if_name_exists(