Skip to content

Commit

Permalink
Merge pull request #20 from ral-facilities/17_allow_empty_filters
Browse files Browse the repository at this point in the history
Allow empty filters
  • Loading branch information
keiranjprice101 authored Jul 1, 2019
2 parents 47d33c8 + 2862b7c commit 457630e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def get_rows_by_filter(table, filters):
session = get_icat_db_session()
base_query = session.query(table)
for filter in filters:
if list(filter)[0].lower() == "where":
if len(filter) == 0:
pass
elif list(filter)[0].lower() == "where":
for key in filter:
where_part = filter[key]
for k in where_part:
Expand Down

0 comments on commit 457630e

Please sign in to comment.