Skip to content

Commit

Permalink
fixing the error that exercises and subjects have been showing even t…
Browse files Browse the repository at this point in the history
…he membership was not there
  • Loading branch information
ooemperor committed Feb 18, 2024
1 parent 03834aa commit 8f69a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion codeGrader/frontend/user/handlers/Exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def get(self) -> str:
@return: The rendered template
"""
exercises = self.api.get("/exercises")
temp_exercises = exercises["exercise"].copy()

for ex in exercises["exercise"]:
for ex in temp_exercises:
# filtering only the exercises that are allowed by the memberships
if not self.user.check_permission(subject_id=ex["subject_id"]):
exercises["exercise"].remove(ex)
Expand Down
4 changes: 2 additions & 2 deletions codeGrader/frontend/user/handlers/Subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def get(self) -> str:
@return: The rendered template
"""
subjects = self.api.get("/subjects")
temp_subjects = subjects["subject"].copy()


for sub in subjects["subject"]:
for sub in temp_subjects:
# filtering only the subjects that are allowed by the memberships
if not self.user.check_permission(subject_id=sub["id"]):
subjects["subject"].remove(sub)
Expand Down

0 comments on commit 8f69a21

Please sign in to comment.