Skip to content

Commit

Permalink
Merge pull request #15 from mrbokster/bugfix/filter-listing
Browse files Browse the repository at this point in the history
Bugfix for filter listing when items is null
  • Loading branch information
gitgiggety authored Nov 14, 2023
2 parents 2f40969 + 179bbf7 commit a1a04a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/lib/criterion_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ def parse_criterion(criterion):

value = criterion.get('value', '')
if isinstance(value, dict) and 'depth' in value:
if 'items' in value:
if value.get('items') is not None:
filter['value'] = list(map(lambda v: v['id'], value['items']))

if 'excluded' in value:
if value.get('excluded') is not None:
filter['excludes'] = list(map(lambda v: v['id'], value['excluded']))

filter['depth'] = value['depth']
elif isinstance(value, dict) and not value.keys() - ['value', 'value2']:
filter.update(value)
elif isinstance(value, list):
filter['value'] = list(map(lambda v: v['id'], value))
else:
elif 'value' in criterion:
filter['value'] = value

return filter

0 comments on commit a1a04a2

Please sign in to comment.