From 16a26afdcec650a06c9c3eca1316f92c54fc09ce Mon Sep 17 00:00:00 2001 From: relikd Date: Wed, 6 Apr 2022 22:58:44 +0200 Subject: [PATCH] fix data model enumeration with no flow blocks --- lektor_groupby/watcher.py | 6 ++++-- setup.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lektor_groupby/watcher.py b/lektor_groupby/watcher.py index d166103..a120ae2 100644 --- a/lektor_groupby/watcher.py +++ b/lektor_groupby/watcher.py @@ -74,8 +74,10 @@ class GroupByModelReader: ''' assert isinstance(record, Record) for r_key, subs in self._models.get(record.datamodel.id, {}).items(): + field = record[r_key] + if not field: + continue if subs == '*': # either normal field or flow type (all blocks) - field = record[r_key] if flatten and isinstance(field, Flow): for i, flow in enumerate(field.blocks): flowtype = flow['_flowblock'] @@ -86,7 +88,7 @@ class GroupByModelReader: else: yield FieldKeyPath(r_key), field else: # always flow type (only some blocks) - for i, flow in enumerate(record[r_key].blocks): + for i, flow in enumerate(field.blocks): flowtype = flow['_flowblock'] for f_key in self._flows.get(flowtype, []): yield FieldKeyPath(r_key, i, f_key), flow[f_key] diff --git a/setup.py b/setup.py index 7837180..9af023b 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ setup( 'cluster', ], classifiers=[ - 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Environment :: Plugins', 'Framework :: Lektor',