Skip to content

Commit

Permalink
#119: Remove irrelevant 404s when no data is found
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Feb 19, 2021
1 parent 6662f86 commit c1fc105
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions datagateway_api/common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@ def get_entity_with_filters(client, entity_type, filters):

data = query.execute_query(client, True)

if not data:
raise MissingRecordError("No results found")
else:
return data
return data


def get_count_with_filters(client, entity_type, filters):
Expand Down Expand Up @@ -350,11 +347,8 @@ def get_count_with_filters(client, entity_type, filters):

data = query.execute_query(client, True)

if not data:
raise MissingRecordError("No results found")
else:
# Only ever 1 element in a count query result
return data[0]
# Only ever 1 element in a count query result
return data[0]


def get_first_result_with_filters(client, entity_type, filters):
Expand Down Expand Up @@ -587,10 +581,7 @@ def get_facility_cycles_for_instrument(

data = query.execute_query(client, True)

if not data:
raise MissingRecordError("No results found")
else:
return data
return data


def get_facility_cycles_for_instrument_count(client, instrument_id, filters):
Expand Down Expand Up @@ -672,10 +663,7 @@ def get_investigations_for_instrument_in_facility_cycle(

data = query.execute_query(client, True)

if not data:
raise MissingRecordError("No results found")
else:
return data
return data


def get_investigations_for_instrument_in_facility_cycle_count(
Expand Down

0 comments on commit c1fc105

Please sign in to comment.