1
0
mirror of https://github.com/etesync/server synced 2024-12-27 09:48:24 +00:00

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

It wasn't actually saving the unusable password before.
This commit is contained in:
Tom Hacohen 2020-07-13 15:40:14 +03:00
parent a39617cf2e
commit af86d877f2

View File

@ -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: