cleanup, get rid of print statements, etc.

This commit is contained in:
Kenneth Kehl
2023-06-15 10:45:03 -07:00
parent 95a2db6991
commit e4a98dfcc2
5 changed files with 35 additions and 39 deletions

View File

@@ -354,7 +354,6 @@ def get_service_history(service_id):
def get_all_notifications_for_service(service_id):
if request.method == 'GET':
data = notifications_filter_schema.load(request.args)
print(f"DATA IS {data}")
elif request.method == 'POST':
# Must transform request.get_json() to MultiDict as NotificationsFilterSchema expects a MultiDict.
# Unlike request.args, request.get_json() does not return a MultiDict but instead just a dict.
@@ -388,7 +387,6 @@ def get_all_notifications_for_service(service_id):
include_from_test_key=include_from_test_key,
include_one_off=include_one_off
)
print(f"PAGINATION ITEMS = {pagination.items}")
kwargs = request.args.to_dict()
kwargs['service_id'] = service_id
@@ -397,7 +395,6 @@ def get_all_notifications_for_service(service_id):
notifications = [notification.serialize_for_csv() for notification in pagination.items]
else:
notifications = notification_with_template_schema.dump(pagination.items, many=True)
print(f"NOTIFICATIONS AFTER FORMATTING {notifications}")
# 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
@@ -516,13 +513,10 @@ def get_detailed_service(service_id, today_only=False):
def get_service_statistics(service_id, today_only, limit_days=7):
# today_only flag is used by the send page to work out if the service will exceed their daily usage by sending a job
if today_only:
print("TODAY ONLY")
stats = dao_fetch_todays_stats_for_service(service_id)
else:
print("PAST WEEK")
stats = fetch_notification_status_for_service_for_today_and_7_previous_days(service_id, limit_days=limit_days)
print(f"GET_SERVICE_STATISTICS returns {statistics.format_statistics(stats)}")
return statistics.format_statistics(stats)