reformat code with black
This commit is contained in:
+9
-11
@@ -9,21 +9,19 @@ def check_api_key():
|
||||
return
|
||||
auth = request.authorization
|
||||
if not auth or not auth.username in api_keys:
|
||||
response = json.dumps(
|
||||
{'status': 401, 'message': 'No valid API key provided'})
|
||||
response = json.dumps({"status": 401, "message": "No valid API key provided"})
|
||||
return Response(
|
||||
response, 401,
|
||||
{'WWW-Authenticate': 'Basic realm="Login Required"'}
|
||||
response, 401, {"WWW-Authenticate": 'Basic realm="Login Required"'}
|
||||
)
|
||||
|
||||
|
||||
def pagination_to_dict(pagination):
|
||||
return {
|
||||
'page': pagination.page,
|
||||
'pages': pagination.pages,
|
||||
'next_num': pagination.next_num,
|
||||
'per_page': pagination.per_page,
|
||||
'has_next': pagination.has_next,
|
||||
'has_prev': pagination.has_prev,
|
||||
'total': pagination.total
|
||||
"page": pagination.page,
|
||||
"pages": pagination.pages,
|
||||
"next_num": pagination.next_num,
|
||||
"per_page": pagination.per_page,
|
||||
"has_next": pagination.has_next,
|
||||
"has_prev": pagination.has_prev,
|
||||
"total": pagination.total,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user