Skip to content

Commit

Permalink
#17: throw exception if filter is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jun 28, 2019
1 parent 47d33c8 commit 76d756b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def update_row_from_id(table, id, new_values):
def get_rows_by_filter(table, filters):
session = get_icat_db_session()
base_query = session.query(table)


for filter in filters:
if len(filter) == 0:
raise BadFilterError()
if list(filter)[0].lower() == "where":
for key in filter:
where_part = filter[key]
Expand Down

0 comments on commit 76d756b

Please sign in to comment.