Skip to content

Commit

Permalink
hopefully fixes "local variable own_submissions referenced before ass…
Browse files Browse the repository at this point in the history
…ignment"
  • Loading branch information
alexeygrigorev committed Oct 11, 2024
1 parent f59e974 commit df4091b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions courses/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ def projects_list_view(request, course_slug, project_slug):
user = request.user
is_authenticated = user.is_authenticated

review_ids = {}
own_submissions = set()

if is_authenticated:
student_submissions = ProjectSubmission.objects.filter(
project=project, student=user
Expand All @@ -528,14 +531,10 @@ def projects_list_view(request, course_slug, project_slug):
submission_under_evaluation__project=project,
)

review_ids = {}

for review in reviews:
eval_id = review.submission_under_evaluation_id
review_ids[eval_id] = review
else:
review_ids = {}
own_submissions = set()


for submission in submissions:
if submission.id in review_ids:
Expand Down

0 comments on commit df4091b

Please sign in to comment.