From 7aa6f6254558b878ad63841e4deac84611ec6ffc Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Fri, 31 May 2024 12:02:50 -0400 Subject: [PATCH] Fix debug statement This changeset fixes a recently added debug statement that was assuming a list was not empty, which was causing end-to-end tests to break in the admin site. Signed-off-by: Carlo Costino --- app/service/rest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/service/rest.py b/app/service/rest.py index b33de20df..be8d55f45 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -472,7 +472,12 @@ def get_all_notifications_for_service(service_id): pagination.items, many=True ) current_app.logger.debug(f"number of notifications are {len(notifications)}") - current_app.logger.debug(f"first notification is {notifications[0]}") + + if len(notifications) > 0: + current_app.logger.debug(f"first notification is {notifications[0]}") + else: + current_app.logger.debug("there are no notifications to show") + # We try and get the next page of results to work out if we need provide a pagination link to the next page # in our response if it exists. Note, this could be done instead by changing `count_pages` in the previous # call to be True which will enable us to use Flask-Sqlalchemy to tell if there is a next page of results but