feat: expand platform APIs, sources, and test coverage
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped

This commit is contained in:
2026-03-17 12:56:48 +01:00
parent b505c67968
commit 3d298ce352
101 changed files with 8387 additions and 292 deletions

View File

@@ -232,8 +232,9 @@ class BackgroundJobStatusView(APIView):
job = BackgroundJobService.get_by_task_id(task_id)
# Проверка доступа: только владелец или админ
if job.user_id and job.user_id != request.user.id and not request.user.is_staff:
# Проверка доступа: только владелец или админ.
# Задачи без владельца считаем системными и не показываем обычным пользователям.
if not request.user.is_staff and job.user_id != request.user.id:
return Response(
{"detail": "Нет доступа к этой задаче"},
status=status.HTTP_403_FORBIDDEN,
@@ -275,7 +276,9 @@ class BackgroundJobListView(APIView):
try:
limit = int(limit_raw)
except (TypeError, ValueError) as exc:
raise ValidationError({"limit": "Параметр limit должен быть целым числом"}) from exc
raise ValidationError(
{"limit": "Параметр limit должен быть целым числом"}
) from exc
if limit < 1:
raise ValidationError({"limit": "Параметр limit должен быть больше 0"})
limit = min(limit, 100)