Commit 26916f7d authored by fnux's avatar fnux

Validate username format in what seem to be WIP API?

parent ac7d9df7
......@@ -511,6 +511,10 @@ class UserCreateAPI(APIView):
if username == "" or not username:
return Response('Please supply a username.', 400)
if not is_username_valid(username):
return Response('Username is not valid.', 400)
except ValidationError:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment