From a92c4bc17ae3e83961de48f482c143e268ebf92c Mon Sep 17 00:00:00 2001
From: mlbonhomme <bonhomme@teklia.com>
Date: Mon, 20 May 2024 11:45:03 +0200
Subject: [PATCH] Use default DB when listing worker version and user worker
 runs

---
 arkindex/process/api.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arkindex/process/api.py b/arkindex/process/api.py
index 09703baa6e..a129558bad 100644
--- a/arkindex/process/api.py
+++ b/arkindex/process/api.py
@@ -971,6 +971,7 @@ class WorkerVersionList(WorkerACLMixin, ListCreateAPIView):
                 | Q(revision__refs__type=GitRefType.Branch, revision__refs__name__in=["master", "main"])
             )
         return self.worker.versions \
+            .using("default") \
             .filter(filters) \
             .prefetch_related("revision__repo", "revision__refs", "worker__type") \
             .distinct() \
@@ -1398,6 +1399,7 @@ class UserWorkerRunList(ProcessACLMixin, ListAPIView):
         if not self.local_process:
             return []
         return self.local_process.worker_runs \
+            .using("default") \
             .select_related(
                 "version__worker__repository",
                 "version__worker__type",
-- 
GitLab