Skip to content

Commit 2742147

Browse files
committed
Cleanup variable usage in messages
1 parent 18617cb commit 2742147

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sogs/routes/general.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def parse_batch_req(r):
7777
abort(http.BAD_REQUEST)
7878
headers = r['headers']
7979

80-
has_body = r['method'] in ('POST', 'PUT')
81-
if not has_body and r['method'] not in ('GET', 'DELETE'):
82-
app.logger.warning(f"Bad batch request: invalid request method {r['method']}")
80+
has_body = method in ('POST', 'PUT')
81+
if not has_body and method not in ('GET', 'DELETE'):
82+
app.logger.warning(f"Bad batch request: invalid request method {method}")
8383
abort(http.BAD_REQUEST)
8484

8585
if not path.startswith('/'):
@@ -89,11 +89,11 @@ def parse_batch_req(r):
8989
n_bodies = sum(k in r for k in ('b64', 'json', 'bytes'))
9090
if has_body:
9191
if not n_bodies:
92-
app.logger.warning(f"Bad batch request: {r['method']} requires one of json/b64/bytes")
92+
app.logger.warning(f"Bad batch request: {method} requires one of json/b64/bytes")
9393
abort(http.BAD_REQUEST)
9494
elif n_bodies > 1:
9595
app.logger.warning(
96-
f"Bad batch request: {r['method']} cannot have more than one of json/bytes/b64"
96+
f"Bad batch request: {method} cannot have more than one of json/bytes/b64"
9797
)
9898
abort(http.BAD_REQUEST)
9999

0 commit comments

Comments
 (0)