From 95bd18272885966c98c44ab824731422d49a7b32 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Sat, 22 Apr 2023 17:44:46 +0500 Subject: [PATCH 1/2] username limit between 5 and 15 characters --- src/apps/profiles/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/profiles/forms.py b/src/apps/profiles/forms.py index c2b0b43cc..9ef7df7d6 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: From 25170a05b5bdfa04620a2ccc848bbc384659170e Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Sat, 22 Apr 2023 21:00:57 +0500 Subject: [PATCH 2/2] whitespace added circle ci --- src/apps/profiles/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/profiles/forms.py b/src/apps/profiles/forms.py index 9ef7df7d6..ba75c6a55 100644 --- a/src/apps/profiles/forms.py +++ b/src/apps/profiles/forms.py @@ -17,7 +17,7 @@ def clean_username(self): raise forms.ValidationError( "Usernames should not contain special characters." ) - if (len(data) > 15 or len(data)< 5): + if (len(data) > 15) or (len(data) < 5): raise forms.ValidationError( "Username must have at least 5 characters and at most 15 characters" )