Fixed passwords not being saved on registration

This commit is contained in:
Keannu Bernasol 2023-11-20 00:22:51 +08:00
parent 8cb45d4e50
commit 3ca24d395d

View file

@ -43,3 +43,10 @@ class UserRegistrationSerializer(serializers.ModelSerializer):
) )
return super().validate(attrs) return super().validate(attrs)
def create(self, validated_data):
user = self.Meta.model(**validated_data)
user.set_password(validated_data['password'])
user.save()
return user