Reformat arguments for readability

We want to add another argument here, and doing so would make the line
length too long with all the arguments on one line.

Also uses the * operator to enforce keyword-only arguments.
This commit is contained in:
Chris Hill-Scott
2020-05-12 10:47:14 +01:00
parent 2f8947afde
commit 27a0ba1a65
2 changed files with 21 additions and 6 deletions

View File

@@ -128,10 +128,12 @@ def get_jobs_by_service(service_id):
else:
limit_days = None
statuses = [x.strip() for x in request.args.get('statuses', '').split(',')]
page = int(request.args.get('page', 1))
return jsonify(**get_paginated_jobs(service_id, limit_days, statuses, page))
return jsonify(**get_paginated_jobs(
service_id,
limit_days=limit_days,
statuses=[x.strip() for x in request.args.get('statuses', '').split(',')],
page=int(request.args.get('page', 1)),
))
@job_blueprint.route('', methods=['POST'])
@@ -185,7 +187,13 @@ def create_job(service_id):
return jsonify(data=job_json), 201
def get_paginated_jobs(service_id, limit_days, statuses, page):
def get_paginated_jobs(
service_id,
*,
limit_days,
statuses,
page,
):
pagination = dao_get_jobs_by_service_id(
service_id,
limit_days=limit_days,