mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Add more logging for getting next page logic
This commit is contained in:
@@ -154,9 +154,9 @@ def generate_notifications_csv(**kwargs):
|
|||||||
kwargs['page'] = 1
|
kwargs['page'] = 1
|
||||||
|
|
||||||
while kwargs['page']:
|
while kwargs['page']:
|
||||||
|
current_app.logger.info('Current kwargs: {}'.format(kwargs))
|
||||||
notifications_resp = notification_api_client.get_notifications_for_service(**kwargs)
|
notifications_resp = notification_api_client.get_notifications_for_service(**kwargs)
|
||||||
current_app.logger.info('Total notifications for csv job: {}'.format(notifications_resp['total']))
|
current_app.logger.info('Total notifications for csv job: {}'.format(notifications_resp['total']))
|
||||||
current_app.logger.info('Notification response links: {}'.format(notifications_resp['links']))
|
|
||||||
notifications_list = notifications_resp['notifications']
|
notifications_list = notifications_resp['notifications']
|
||||||
for x in notifications_list:
|
for x in notifications_list:
|
||||||
csvwriter.writerow(format_notification_for_csv(x))
|
csvwriter.writerow(format_notification_for_csv(x))
|
||||||
@@ -166,8 +166,14 @@ def generate_notifications_csv(**kwargs):
|
|||||||
yield line
|
yield line
|
||||||
|
|
||||||
if notifications_resp['links'].get('next'):
|
if notifications_resp['links'].get('next'):
|
||||||
|
current_app.logger.info('Next link exists')
|
||||||
|
current_app.logger.info('Notification response links: {}'.format(notifications_resp['links']))
|
||||||
|
current_app.logger.info('Current page {}'.format(kwargs['page']))
|
||||||
kwargs['page'] += 1
|
kwargs['page'] += 1
|
||||||
else:
|
else:
|
||||||
|
current_app.logger.info('No next link exists')
|
||||||
|
current_app.logger.info('Notification response links: {}'.format(notifications_resp['links']))
|
||||||
|
current_app.logger.info('Current page {}'.format(kwargs['page']))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user