mirror of
https://github.com/etesync/server
synced 2024-12-28 02:08:08 +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:
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…
Reference in New Issue
Block a user