Signup: use the shorthand version of setting an unusable password.

It wasn't actually saving the unusable password before.
pull/56/head
Tom Hacohen 4 years ago
parent a39617cf2e
commit af86d877f2

@ -397,13 +397,11 @@ class AuthenticationSignupSerializer(serializers.Serializer):
instance = User.objects.get_by_natural_key(user_data['username'])
except User.DoesNotExist:
# Create the user and save the casing the user chose as the first name
instance = User.objects.create_user(**user_data, first_name=user_data['username'])
instance = User.objects.create_user(**user_data, password=None, first_name=user_data['username'])
if hasattr(instance, 'userinfo'):
raise serializers.ValidationError('User already exists')
instance.set_unusable_password()
try:
instance.clean_fields()
except django_exceptions.ValidationError as e:

Loading…
Cancel
Save