mirror of
https://github.com/lemeow125/EquipmentTracker-Backend.git
synced 2024-11-16 21:59:25 +08:00
Fixed passwords not being saved on registration
This commit is contained in:
parent
8cb45d4e50
commit
3ca24d395d
1 changed files with 7 additions and 0 deletions
|
@ -43,3 +43,10 @@ class UserRegistrationSerializer(serializers.ModelSerializer):
|
|||
)
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue