mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Merge pull request #2284 from alphagov/add-count-pages-flag-to-service-notifications
Don't return pagination links for API Message log requests
This commit is contained in:
@@ -255,6 +255,7 @@ def get_notifications_for_service(
|
||||
filter_dict=None,
|
||||
page=1,
|
||||
page_size=None,
|
||||
count_pages=True,
|
||||
limit_days=None,
|
||||
key_type=None,
|
||||
personalisation=False,
|
||||
@@ -300,7 +301,8 @@ def get_notifications_for_service(
|
||||
|
||||
return query.order_by(desc(Notification.created_at)).paginate(
|
||||
page=page,
|
||||
per_page=page_size
|
||||
per_page=page_size,
|
||||
count=count_pages
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -596,6 +596,7 @@ class NotificationsFilterSchema(ma.Schema):
|
||||
format_for_csv = fields.String()
|
||||
to = fields.String()
|
||||
include_one_off = fields.Boolean(required=False)
|
||||
count_pages = fields.Boolean(required=False)
|
||||
|
||||
@pre_load
|
||||
def handle_multidict(self, in_data):
|
||||
|
||||
@@ -344,16 +344,20 @@ def get_all_notifications_for_service(service_id):
|
||||
include_from_test_key = data.get('include_from_test_key', False)
|
||||
include_one_off = data.get('include_one_off', True)
|
||||
|
||||
count_pages = data.get('count_pages', True)
|
||||
|
||||
pagination = notifications_dao.get_notifications_for_service(
|
||||
service_id,
|
||||
filter_dict=data,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
count_pages=count_pages,
|
||||
limit_days=limit_days,
|
||||
include_jobs=include_jobs,
|
||||
include_from_test_key=include_from_test_key,
|
||||
include_one_off=include_one_off
|
||||
)
|
||||
|
||||
kwargs = request.args.to_dict()
|
||||
kwargs['service_id'] = service_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user