Skip to content
Snippets Groups Projects
Commit aad9813a authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Prevent listing process' tasks in user jobs

parent b0a7bb4c
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !2227. Comments created here will be created in the context of that merge request.
......@@ -53,6 +53,12 @@ from arkindex.users.utils import RightContent, get_max_level
logger = logging.getLogger(__name__)
# Process tasks running in RQ are hidden from user jobs
VISIBLE_QUEUES = [
q for q in QUEUES.keys()
if q != "tasks"
]
@extend_schema(tags=["users"])
@extend_schema_view(
......@@ -340,7 +346,7 @@ class JobRetrieve(RetrieveDestroyAPIView):
serializer_class = JobSerializer
def get_object(self):
for queue_name in QUEUES.keys():
for queue_name in VISIBLE_QUEUES:
job = get_queue(queue_name).fetch_job(str(self.kwargs["pk"]))
if not job:
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment