diff --git a/progress/views.py b/progress/views.py index 66f7a6e..7fe4dc3 100644 --- a/progress/views.py +++ b/progress/views.py @@ -197,12 +197,13 @@ class StudentUpdateProgress(APIView): pv.status = ProgressLesson.STATUSES.done pv.finish_date = datetime.datetime.now() - elif not comment is None: + elif not comment is None and\ + not pv.progress.progresslesson_set.filter(status=ProgressLesson.STATUSES.wait).exists(): pv.status = ProgressLesson.STATUSES.wait pv.comment_tokens.append(comment) else: - raise ValueError("Этого никогда не должно происходить, но я уверен, что произойдёт") + raise ValueError("Вероятней всего тут отшили студента который пытался здать вторую домашку подряд") elif not comment is None: pv.comment_tokens.append(comment)