mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
refactor: clean up scaffolding backend
This commit is contained in:
@@ -8,10 +8,18 @@ class UserSerializer(serializers.ModelSerializer):
|
||||
password = serializers.CharField(write_only=True)
|
||||
|
||||
class Meta:
|
||||
"""
|
||||
Specifies the public_id as readonly for the system to auto generate
|
||||
"""
|
||||
|
||||
model = User
|
||||
fields = ("public_id", "email", "full_name", "password")
|
||||
read_only_fields = ("public_id",)
|
||||
|
||||
def create(self, validated_data):
|
||||
"""
|
||||
Validates and creates a new user with the given data.
|
||||
"""
|
||||
user = User.objects.create_user(
|
||||
email=validated_data["email"],
|
||||
password=validated_data["password"],
|
||||
|
||||
Reference in New Issue
Block a user