diff --git a/HISTORY.rst b/HISTORY.rst index 5cf3210..4af6588 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,8 @@ History - Nothing changed yet. +- Fix Lines lookup index bug for single cell models + 2.2.0 (2023-11-07) ------------------ diff --git a/threedigrid/admin/h5py_datasource.py b/threedigrid/admin/h5py_datasource.py index 85c88d9..e228b0a 100644 --- a/threedigrid/admin/h5py_datasource.py +++ b/threedigrid/admin/h5py_datasource.py @@ -106,7 +106,10 @@ def execute_query(self, model): timeseries_filter = model.get_timeseries_mask_filter() if model._mixin and hasattr(model.Meta, "lookup_fields"): - lookup_index = model._meta._get_lookup_index() + try: # Single cell models don't have Lines + lookup_index = model._meta._get_lookup_index() + except AttributeError: + return np.array([]) if model._mixin and hasattr(model.Meta, "subset_fields"): has_subsets = True