UI bugfixes with boss

This commit is contained in:
Константин Лебединский
2026-04-30 19:53:49 +05:00
parent df6e770f90
commit b72b485fce
17 changed files with 469 additions and 250 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ from sqlalchemy.orm import selectinload
from ..db import get_session
from ..messages import RU
from ..models import AnswerOption, Question, Test, TestVersion
from .test_access import is_test_author
from .test_access import is_test_author, is_test_edit_open
from .test_chain import has_any_attempt_for_test
@@ -67,7 +67,7 @@ def get_editor_content(user_id: str, test_id: str) -> dict:
test = session.get(Test, tid)
if not test:
raise HttpError(404, 'Тест не найден.')
if not is_test_author(test.created_by, user_id):
if not is_test_author(test.created_by, user_id) and not is_test_edit_open():
raise HttpError(403, 'Доступ запрещён.')
active_version = (