1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-22 14:25:01 +01:00

dspace_statistics_api/util.py: Fix f-strings

flake8 raised this warning:

    F541 f-string is missing placeholders
This commit is contained in:
Alan Orth 2020-10-06 15:11:12 +03:00
parent 58d2b8d4ed
commit 630fa0d5fb
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -85,7 +85,7 @@ def validate_items_post_parameters(req, resp, resource, params):
doc = json.load(req.bounded_stream) doc = json.load(req.bounded_stream)
else: else:
raise falcon.HTTPBadRequest( raise falcon.HTTPBadRequest(
title="Invalid request", description=f"Request body is empty." title="Invalid request", description="Request body is empty."
) )
# Parse date parameters from request body (will raise an HTTPBadRequest # Parse date parameters from request body (will raise an HTTPBadRequest
@ -107,7 +107,7 @@ def validate_items_post_parameters(req, resp, resource, params):
else: else:
raise falcon.HTTPBadRequest( raise falcon.HTTPBadRequest(
title="Invalid parameter", title="Invalid parameter",
description=f'The "limit" parameter is invalid. The value must be an integer between 0 and 100.', description='The "limit" parameter is invalid. The value must be an integer between 0 and 100.',
) )
else: else:
req.context.limit = 100 req.context.limit = 100
@ -119,7 +119,7 @@ def validate_items_post_parameters(req, resp, resource, params):
else: else:
raise falcon.HTTPBadRequest( raise falcon.HTTPBadRequest(
title="Invalid parameter", title="Invalid parameter",
description=f'The "page" parameter is invalid. The value must be at least 0.', description='The "page" parameter is invalid. The value must be at least 0.',
) )
else: else:
req.context.page = 0 req.context.page = 0
@ -131,7 +131,7 @@ def validate_items_post_parameters(req, resp, resource, params):
else: else:
raise falcon.HTTPBadRequest( raise falcon.HTTPBadRequest(
title="Invalid parameter", title="Invalid parameter",
description=f'The "items" parameter is invalid. The value must be a comma-separated list of item UUIDs.', description='The "items" parameter is invalid. The value must be a comma-separated list of item UUIDs.',
) )
else: else:
req.context.items = list() req.context.items = list()