From 268069eeb41bc6e0c67f5dde01149e5f73db0e63 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 24 Sep 2023 21:33:16 +0800 Subject: [PATCH] Restrict access to StudyGroupListNearView if student status is inactive to prevent errors --- stude/study_groups/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stude/study_groups/views.py b/stude/study_groups/views.py index 7523373..4f92cab 100644 --- a/stude/study_groups/views.py +++ b/stude/study_groups/views.py @@ -72,6 +72,9 @@ class StudyGroupListNearView(generics.ListAPIView): "You must be a student to view study groups" ) + if user_status.active is False: + raise exceptions.ValidationError("Student Status is not active") + # Get the user's course user_course = user.course print(user_course)