Skip to content

Commit

Permalink
#150: Fix logging issues when dealing with session IDs which are str…
Browse files Browse the repository at this point in the history
…ings, not numbers

- When dealing with session IDs, you cannot assume they are numbers, since they're in the format of UUIDs, so %s is more suitable
  • Loading branch information
MRichards99 committed Dec 3, 2020
1 parent c676f46 commit c29f68e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datagateway_api/common/database/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def get_row_by_id(table, id_):
:return: the record retrieved
"""
with ReadQuery(table) as read_query:
log.info(" Querying %s for record with ID: %d", table.__tablename__, id_)
log.info(" Querying %s for record with ID: %s", table.__tablename__, id_)
where_filter = WhereFilter("ID", id_, "eq")
where_filter.apply_filter(read_query)
return read_query.get_single_result()
Expand All @@ -239,7 +239,7 @@ def delete_row_by_id(table, id_):
:param table: the table to be searched
:param id_: the id of the record to delete
"""
log.info(" Deleting row from %s with ID: %d", table.__tablename__, id_)
log.info(" Deleting row from %s with ID: %s", table.__tablename__, id_)
row = get_row_by_id(table, id_)
with DeleteQuery(table, row) as delete_query:
delete_query.execute_query()
Expand Down

0 comments on commit c29f68e

Please sign in to comment.