Validate username format in what seem to be WIP API?
This commit is contained in:
parent
ac7d9df7a9
commit
26916f7def
1 changed files with 4 additions and 0 deletions
|
@ -511,6 +511,10 @@ class UserCreateAPI(APIView):
|
||||||
|
|
||||||
if username == "" or not username:
|
if username == "" or not username:
|
||||||
return Response('Please supply a username.', 400)
|
return Response('Please supply a username.', 400)
|
||||||
|
|
||||||
|
if not is_username_valid(username):
|
||||||
|
return Response('Username is not valid.', 400)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
validate_email(email)
|
validate_email(email)
|
||||||
except ValidationError:
|
except ValidationError:
|
||||||
|
|
Loading…
Reference in a new issue