Skip to content

Commit

Permalink
fix: extra_kwargs, user
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jan 29, 2024
1 parent b803a07 commit d64ecf4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions codeforlife/user/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@

# pylint: disable-next=missing-class-docstring
class UserSerializer(ModelSerializer[User]):
student = StudentSerializer(
source="new_student",
read_only=True,
)
student = StudentSerializer(source="new_student")

teacher = TeacherSerializer(
source="new_teacher",
read_only=True,
)
teacher = TeacherSerializer(source="new_teacher")

# pylint: disable-next=missing-class-docstring,too-few-public-methods
class Meta:
Expand All @@ -35,6 +29,8 @@ class Meta:
"date_joined",
]
extra_kwargs = {
"student": {"read_only": True},
"teacher": {"read_only": True},
"id": {"read_only": True},
"first_name": {"read_only": True},
"last_name": {"read_only": True},
Expand Down

0 comments on commit d64ecf4

Please sign in to comment.