Skip to content

Commit

Permalink
string management: use the newest recommanded way to handle litterals…
Browse files Browse the repository at this point in the history
… with the .format method instead of str()
  • Loading branch information
s-pace committed May 27, 2019
1 parent e5b28d1 commit 020ef9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion deployer/src/algolia_internal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def get_headers():
admin_api_key = environ.get('API_KEY_PROD').encode()
auth_token = b64encode(app_id + b":" + admin_api_key).decode().replace('=',
'').replace(

"\n", '')

return {
Expand Down
9 changes: 4 additions & 5 deletions deployer/src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
data=data)

if r.status_code // 100 != 2:
print("ISSUE for POST request : " + url + " with params: " + str(
print('ISSUE for POST request : {} with params: {}'.format(url,
data))
print(r.text)
return r
Expand All @@ -77,8 +77,7 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
auth=(username, password))

if r.status_code not in success_codes:
print(
'ISSUE for DELETE request : {} with params: {}'.format(url,
print('ISSUE for DELETE request : {} with params: {}'.format(url,
data))
return r

Expand All @@ -88,7 +87,7 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
data=data)
print(r.status_code)
if r.status_code // 100 != 2:
print("ISSUE for PUT request : " + url + " with params: " + str(
print('ISSUE for PUT request : {} with params: {}'.format(url,
data))
return r

Expand All @@ -101,7 +100,7 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
auth=(username, password))

if r.status_code // 100 != 2:
print("ISSUE for GET request : " + url + " with params:" + data)
print('ISSUE for GET request : {} with params: {}'.format(url, data))

if json_request:
r.json()
Expand Down

0 comments on commit 020ef9b

Please sign in to comment.