summaryrefslogtreecommitdiff
path: root/archaeological_warehouse
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r--archaeological_warehouse/models.py8
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: