From f6ebd91f8537fe36b64433e4993673e3539bb4f7 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 7 Aug 2023 15:37:47 +0800 Subject: [PATCH] Simplified the status serializer --- stude/student_status/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stude/student_status/serializers.py b/stude/student_status/serializers.py index b1b201c..7824e21 100644 --- a/stude/student_status/serializers.py +++ b/stude/student_status/serializers.py @@ -29,10 +29,10 @@ class StudentStatusSerializer(serializers.ModelSerializer): def update(self, instance, validated_data): active = validated_data.get('active', None) - subject = validated_data.get('subject', None) + # subject = validated_data.get('subject', None) - # If status is set as inactive or if no subject is specified in the request, clear the student status - if active is not None and active is False or not subject: + # If status is set as false in the request, clear the student status + if active is False: validated_data['location'] = Point(0, 0) validated_data['subject'] = None validated_data['landmark'] = None