From e8693547cf89163d53d82a11840162132a299f07 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 17 Jul 2023 18:42:40 +0800 Subject: [PATCH] Omit student_status from user serializer --- stude/accounts/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stude/accounts/serializers.py b/stude/accounts/serializers.py index 7665158..ffd7386 100644 --- a/stude/accounts/serializers.py +++ b/stude/accounts/serializers.py @@ -15,8 +15,8 @@ from django.contrib.gis.geos import Point class CustomUserSerializer(BaseUserSerializer): - user_status = StudentStatusSerializer( - source='studentstatus', read_only=True) + # user_status = StudentStatusSerializer( + # source='studentstatus', read_only=True) course = serializers.SlugRelatedField( many=False, slug_field='name', queryset=Course.objects.all(), required=False, allow_null=True) year_level = serializers.SlugRelatedField( @@ -27,7 +27,7 @@ class CustomUserSerializer(BaseUserSerializer): class Meta(BaseUserSerializer.Meta): model = CustomUser fields = ('username', 'email', - 'student_id_number', 'year_level', 'semester', 'course', 'subjects', 'avatar', 'first_name', 'last_name', 'is_banned', 'user_status') + 'student_id_number', 'year_level', 'semester', 'course', 'subjects', 'avatar', 'first_name', 'last_name', 'is_banned') read_only_fields = ('is_banned', 'user_status') # The model from your custom user