diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-19 11:54:38 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-19 12:44:45 +0100 |
commit | b0c2ded8e95dcf61b36685fec4b40d9bcf82bef0 (patch) | |
tree | 72a8ac0ec7b8c779516bd2d22bb057163b64243d /archaeological_finds | |
parent | c1fa91b2acb68aff15ca1dfbabaf51d8ea83e166 (diff) | |
download | Ishtar-b0c2ded8e95dcf61b36685fec4b40d9bcf82bef0.tar.bz2 Ishtar-b0c2ded8e95dcf61b36685fec4b40d9bcf82bef0.zip |
🚑️ fix huge performance problems on permissions when too many items are attached
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models_finds.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index f140c2d61..fa38a6dbb 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -3078,20 +3078,25 @@ class Find( def _get_query_owns(cls, ishtaruser, prefix=""): q = ( cls._construct_query_own( - f"{prefix}container__location__", Warehouse._get_query_owns_dicts(ishtaruser) + cls, f"{prefix}container__location__", + Warehouse._get_query_owns_dicts(ishtaruser) ) | cls._construct_query_own( - f"{prefix}container__responsible__", Warehouse._get_query_owns_dicts(ishtaruser) + cls, f"{prefix}container__responsible__", + Warehouse._get_query_owns_dicts(ishtaruser) ) | cls._construct_query_own( + cls, f"{prefix}base_finds__context_record__operation__", Operation._get_query_owns_dicts(ishtaruser), ) | cls._construct_query_own( + cls, f"{prefix}basket__", [{"shared_with": ishtaruser, "shared_write_with": ishtaruser}], ) | cls._construct_query_own( + cls, "", [ {f"{prefix}history_creator": ishtaruser.user_ptr}, |