mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Add one_off filter when getting all notifications for a service
Added the option to filter by one_off messages to the DAO function `get_notifications_for_service`. Previously, one-off notifications were not returned - this has changed so that the default is for one-off notifications to be returned. Also simplified the `include_jobs` filter for this function. The DAO function gets used in 3 places - for the V1 and V2 API endpoints, which will now start to return one-off messages. It also gets used by the admin app which needs to pass in `include_one_off=False` to the `get_all_notifications_for_service` where we don't want one-off notifications to show, such as the API message log page.
This commit is contained in:
@@ -335,6 +335,7 @@ def get_all_notifications_for_service(service_id):
|
||||
limit_days = data.get('limit_days')
|
||||
include_jobs = data.get('include_jobs', True)
|
||||
include_from_test_key = data.get('include_from_test_key', False)
|
||||
include_one_off = data.get('include_one_off', True)
|
||||
|
||||
pagination = notifications_dao.get_notifications_for_service(
|
||||
service_id,
|
||||
@@ -343,7 +344,8 @@ def get_all_notifications_for_service(service_id):
|
||||
page_size=page_size,
|
||||
limit_days=limit_days,
|
||||
include_jobs=include_jobs,
|
||||
include_from_test_key=include_from_test_key
|
||||
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