UI bugfixes with boss
This commit is contained in:
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user