Merge pull request #3391 from alphagov/pagination-approach-change

Pagination approach change for `get_notifications_for_service`
This commit is contained in:
David McDonald
2021-12-09 10:43:14 +00:00
committed by GitHub
3 changed files with 84 additions and 9 deletions

View File

@@ -241,7 +241,8 @@ def get_notifications_for_service(
include_from_test_key=False,
older_than=None,
client_reference=None,
include_one_off=True
include_one_off=True,
error_out=True
):
if page_size is None:
page_size = current_app.config['PAGE_SIZE']
@@ -280,7 +281,8 @@ def get_notifications_for_service(
return query.order_by(desc(Notification.created_at)).paginate(
page=page,
per_page=page_size,
count=count_pages
count=count_pages,
error_out=error_out,
)