Skip to content
Snippets Groups Projects
Commit 25c32d68 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Update query

parent 3eb307f7
No related branches found
No related tags found
1 merge request!75Retrieve transcriptions from local cache in list_transcriptions
This commit is part of merge request !75. Comments created here will be created in the context of that merge request.
......@@ -941,16 +941,13 @@ class ElementsWorker(BaseWorker):
"worker_version",
}, "When using the local cache, you can only filter by 'worker_version'"
conditions = [("element_id", "=", convert_str_uuid_to_hex(element.id))]
transcriptions = CachedTranscription.select().where(
CachedTranscription.element_id == element.id
)
if worker_version:
conditions.append(
("worker_version_id", "=", convert_str_uuid_to_hex(worker_version))
transcriptions = transcriptions.where(
CachedTranscription.worker_version_id == worker_version
)
transcriptions = self.cache.fetch(
"transcriptions",
where=conditions,
)
else:
if self.cache:
logger.warning(
......
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