From af86d877f2a26554748722b2dfa197f63020d893 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 13 Jul 2020 15:40:14 +0300 Subject: [PATCH] Signup: use the shorthand version of setting an unusable password. It wasn't actually saving the unusable password before. --- django_etebase/serializers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index 94ab3e7..a77c037 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -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: