Restrict access to StudyGroupListNearView if student status is inactive to prevent errors

This commit is contained in:
Keannu Bernasol 2023-09-24 21:33:16 +08:00
parent 3124c3b6be
commit 268069eeb4

View file

@ -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)