From af44e29af537d1fa288844fbd916bf818ddac4b5 Mon Sep 17 00:00:00 2001 From: Yu Long <82516689+Reimirno@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:49:50 -0700 Subject: [PATCH] Fix: Unhandled bug when batch deleting students by emails (#60) --- .gitignore | 2 +- server/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a2fbb2c..66a3861 100644 --- a/.gitignore +++ b/.gitignore @@ -111,4 +111,4 @@ axe/ gcp-service-account-credentials.json # bootstrap -setup.sh +setup*.sh diff --git a/server/views.py b/server/views.py index b2a0189..1d9c769 100644 --- a/server/views.py +++ b/server/views.py @@ -630,7 +630,7 @@ def delete_students(exam): if not form.use_all_emails.data: emails = [x for x in str_set_to_set(form.emails.data) if x] students = Student.query.filter( - Student.email.in_(emails) & Student.exam_id == exam.id) + Student.email.in_(emails) & (Student.exam_id == exam.id)) else: students = Student.query.filter_by(exam_id=exam.id) deleted = {student.email for student in students}