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
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user