Serializers user signup: correctly handle EtebaseValidationErrors.

Don't coerce them to strings
This commit is contained in:
Tom Hacohen 2020-09-02 12:50:47 +03:00
parent 7ab9513e05
commit 42a72ce5c7

View File

@ -450,6 +450,8 @@ class AuthenticationSignupSerializer(BetterErrorsMixin, serializers.Serializer):
# Create the user and save the casing the user chose as the first name
try:
instance = create_user(**user_data, password=None, first_name=user_data['username'], view=view)
except EtebaseValidationError as e:
raise e
except Exception as e:
raise EtebaseValidationError('generic', str(e))