diff --git a/stude/accounts/models.py b/stude/accounts/models.py index 4f33659..e34a78c 100644 --- a/stude/accounts/models.py +++ b/stude/accounts/models.py @@ -20,11 +20,9 @@ def validate_student_id(value): class CustomUser(AbstractUser): def _get_upload_to(instance, filename): base_filename, file_extension = os.path.splitext(filename) - # Convert filename to a slug format - cleaned_filename = slugify(base_filename) # Get the student ID number student_id = str(instance.student_id_number) - new_filename = f"{student_id}_{cleaned_filename}{file_extension}" + new_filename = f"{student_id}_{file_extension}" return os.path.join('avatars', new_filename) first_name = models.CharField(max_length=100)