chore: Handle forbidden username exceptions on registration (#37185)
This commit is contained in:
@@ -600,7 +600,8 @@ class RegistrationView(APIView):
|
||||
errors = {
|
||||
"error_message": [{"user_message": str(exc)}],
|
||||
}
|
||||
return self._create_response(request, errors, status_code=exc.status_code)
|
||||
error_code = getattr(exc, "error_code", None)
|
||||
return self._create_response(request, errors, status_code=exc.status_code, error_code=error_code)
|
||||
|
||||
response = self._handle_duplicate_email_username(request, data)
|
||||
if response:
|
||||
|
||||
Reference in New Issue
Block a user