diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-24 13:46:12 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:25 +0100 |
commit | 459a6277f80accf134bf6a943fadd6a049151a84 (patch) | |
tree | 26e208eba1e10bebbbc89367750fb8e3bc5dd1c5 /archaeological_warehouse/models.py | |
parent | fb488e18d189e2bd202f01249d80b327a205c107 (diff) | |
download | Ishtar-459a6277f80accf134bf6a943fadd6a049151a84.tar.bz2 Ishtar-459a6277f80accf134bf6a943fadd6a049151a84.zip |
Container: fix label gen with no filter
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index c78a25fbc..be3671c61 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1471,12 +1471,12 @@ class Container(DocumentItem, Merge, LightHistorizedItem, prefix=prefix, no_values=True, filtr=None, **kwargs) for f in self.finds.distinct().all()] - operation_in_filter = any( - k for k in filtr if k.startswith(prefix + 'operation')) - cr_in_filter = any( - k for k in filtr if k.startswith(prefix + 'context_record')) if not self.finds.count(): return + operation_in_filter = filtr and any( + k for k in filtr if k.startswith(prefix + 'operation')) + cr_in_filter = filtr and any( + k for k in filtr if k.startswith(prefix + 'context_record')) if not filtr or prefix + 'material_types' in filtr: values[prefix + 'material_types'] = self.get_material_types() if not filtr or prefix + 'material_types_code' in filtr: |