From 0e41c3034726c0042551912baf7995fde28e3152 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sat, 28 Oct 2023 00:17:07 +0800 Subject: [PATCH] Fixed statement for study group moving --- stude/student_status/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stude/student_status/serializers.py b/stude/student_status/serializers.py index 6276c15..f0def37 100644 --- a/stude/student_status/serializers.py +++ b/stude/student_status/serializers.py @@ -68,7 +68,7 @@ class StudentStatusSerializer(serializers.ModelSerializer): old_study_group.delete() # If student has changed study group, check if the old study_group no longer has any students - if study_group is not old_study_group and old_study_group is not None: + if study_group is not None and study_group is not old_study_group and old_study_group is not None: if not old_study_group.students.exists(): # If there are no students left in the old StudyGroup, delete it old_study_group.delete()