Skip to content

Commit

Permalink
api update
Browse files Browse the repository at this point in the history
  • Loading branch information
luxmagic committed Apr 21, 2024
1 parent 2fc357f commit 932cf5c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Site/back/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from .cipher import *

class UserSerializer(ModelSerializer):
class Meta:
model = Users
fields = ["url", "username", "email", "password", "created_at"]
extra_kwargs = {"password": {"write_only": True}}
class Meta:
model = Users
fields = ["url", "username", "email", "password", "created_at"]
extra_kwargs = {"password": {"write_only": True}}

def create(self, validated_data):
user = Users(username=validated_data["username"])
Expand All @@ -15,10 +15,10 @@ def create(self, validated_data):
return user

class LoggSerializer(ModelSerializer):
class Meta:
model = Logg
fields = ["id", "log", "created_at"]
extra_kwargs = {"log": {"write_only": True}}
class Meta:
model = Logg
fields = ["id", "log", "created_at"]
extra_kwargs = {"log": {"write_only": True}}

def create(self, validated_data):
log = Logg(id=validated_data["id"])
Expand Down

0 comments on commit 932cf5c

Please sign in to comment.