Merge pull request #800 from alphagov/increase-page-size

Increase page size for API calls to 250
This commit is contained in:
Rebecca Law
2017-01-23 14:39:13 +00:00
committed by GitHub
4 changed files with 461 additions and 497 deletions

View File

@@ -68,6 +68,7 @@ class Config(object):
SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_TRACK_MODIFICATIONS = True
PAGE_SIZE = 50
API_PAGE_SIZE = 250
SMS_CHAR_COUNT_LIMIT = 495
BRANDING_PATH = '/images/email-template/crests/'
TEST_MESSAGE_FILENAME = 'Test message'

View File

@@ -175,7 +175,7 @@ def get_all_notifications():
data = notifications_filter_schema.load(request.args).data
include_jobs = data.get('include_jobs', False)
page = data.get('page', 1)
page_size = data.get('page_size', current_app.config.get('PAGE_SIZE'))
page_size = data.get('page_size', current_app.config.get('API_PAGE_SIZE'))
limit_days = data.get('limit_days')
pagination = notifications_dao.get_notifications_for_service(

View File

@@ -1,6 +1,6 @@
import uuid
from flask import jsonify, request, url_for
from flask import jsonify, request, url_for, current_app
from werkzeug.exceptions import abort
from app import api_user
@@ -43,7 +43,8 @@ def get_notifications():
key_type=api_user.key_type,
personalisation=True,
older_than=data.get('older_than'),
client_reference=data.get('reference')
client_reference=data.get('reference'),
page_size=current_app.config.get('API_PAGE_SIZE')
)
def _build_links(notifications):

File diff suppressed because it is too large Load Diff