From 40f65e5e553ca2499ff70bdd293be7861427d6d3 Mon Sep 17 00:00:00 2001 From: Timur Date: Mon, 3 Mar 2025 23:12:57 +0300 Subject: [PATCH] make checker simplier --- services/backend/apps/task/models.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/services/backend/apps/task/models.py b/services/backend/apps/task/models.py index ffb3c08..435f5b3 100644 --- a/services/backend/apps/task/models.py +++ b/services/backend/apps/task/models.py @@ -82,20 +82,20 @@ class CompetitionTask(BaseModel): def clean(self): super().clean() - if self.correct_answer_file and self.type not in ["checker", "input"]: - raise ValidationError({ - "type": "Если загружен файл правильного ответа, то тип проверки не может быть ручным" - }) - elif not self.correct_answer_file and self.type == "review": + # if self.correct_answer_file and self.type not in ["checker", "input"]: + # raise ValidationError({ + # "type": "Если загружен файл правильного ответа, то тип проверки не может быть ручным" + # }) + if not self.correct_answer_file and self.type != "review": raise ValidationError({ "correct_answer_file": "Загрузите правильный ответ" }) - if self.answer_file_path and not self.type == "checker": - raise ValidationError({ - "type": "Укажите другой тип задания: этот не совместим с путем правильного ответа" - }) - elif not self.answer_file_path and self.type == "checker": + # if self.answer_file_path and not self.type == "checker": + # raise ValidationError({ + # "type": "Укажите другой тип задания: этот не совместим с путем правильного ответа" + # }) + if not self.answer_file_path and self.type == "checker": raise ValidationError({ "answer_file_path": "Введите путь правильного ответа - это нужно для корректной работы чекера" }) @@ -104,10 +104,10 @@ class CompetitionTask(BaseModel): raise ValidationError({ "reviewers": "Загрузите ревьюверов - кто будет проверять задания, если не они?" }) - elif self.reviewers and not self.type == "review": - raise ValidationError({ - "type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным" - }) + # elif self.reviewers and not self.type == "review": + # raise ValidationError({ + # "type": "Проверьте тип - вы ввели ревьюверов, но задание не является ручным" + # }) def __str__(self):