mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-16 22:09:25 +08:00
Simplified the status serializer
This commit is contained in:
parent
9902c0fc14
commit
f6ebd91f85
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue