From b0c2ded8e95dcf61b36685fec4b40d9bcf82bef0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 19 Mar 2025 11:54:38 +0100 Subject: 🚑️ fix huge performance problems on permissions when too many items are attached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_context_records/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 8631f49d1..29e8b56a8 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -1236,13 +1236,15 @@ class ContextRecord( def get_query_owns(cls, ishtaruser): return ( cls._construct_query_own( - "operation__", Operation._get_query_owns_dicts(ishtaruser) + cls, "operation__", Operation._get_query_owns_dicts(ishtaruser) ) | cls._construct_query_own( + cls, "base_finds__find__basket__", [{"shared_with": ishtaruser, "shared_write_with": ishtaruser}], ) | cls._construct_query_own( + cls, "", [ {"history_creator": ishtaruser.user_ptr}, -- cgit v1.2.3