From 25d1bd1a6cb4575dbc650767ebfa2438ca8b1bdc Mon Sep 17 00:00:00 2001 From: thegm445 Date: Fri, 1 Dec 2023 21:59:36 -0300 Subject: [PATCH] refactor(apps/tasks): variable names describe better what they store --- apps/tasks/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/tasks/views.py b/apps/tasks/views.py index d7792f5..6140aff 100644 --- a/apps/tasks/views.py +++ b/apps/tasks/views.py @@ -49,7 +49,7 @@ def handle_submission(code: str, task_id: int, submission_id: int) -> None: submission.status = "AC" if output == task.output_file else "WA" submission.save() - has_been_accepted = ( + has_already_scored = ( Submission._default_manager.filter( author=submission.author, task=task, @@ -61,7 +61,7 @@ def handle_submission(code: str, task_id: int, submission_id: int) -> None: if ( submission.status == SubmissionStatus.ACCEPTED - and not has_been_accepted + and not has_already_scored ): submission.author.score += task.score submission.author.save()