diff --git a/src/apps/profiles/forms.py b/src/apps/profiles/forms.py index c2b0b43cc..ba75c6a55 100644 --- a/src/apps/profiles/forms.py +++ b/src/apps/profiles/forms.py @@ -17,6 +17,10 @@ def clean_username(self): raise forms.ValidationError( "Usernames should not contain special characters." ) + if (len(data) > 15) or (len(data) < 5): + raise forms.ValidationError( + "Username must have at least 5 characters and at most 15 characters" + ) return data class Meta: