summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-01-19 18:34:55 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-03-17 18:06:44 (GMT)
commita78e56758398896d812ca1812dc837bb28b711cb (patch)
treedb25bfd3b63e3f35e130a2830f705ea75291b791
parente2eb510f8708d441accf205b02175b42e501f180 (diff)
downloadwelco-a78e56758398896d812ca1812dc837bb28b711cb.zip
welco-a78e56758398896d812ca1812dc837bb28b711cb.tar.gz
welco-a78e56758398896d812ca1812dc837bb28b711cb.tar.bz2
python3: convert .keys to list before comparing (#39092)
-rw-r--r--welco/sources/phone/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/welco/sources/phone/views.py b/welco/sources/phone/views.py
index f04341f..7f59ada 100644
--- a/welco/sources/phone/views.py
+++ b/welco/sources/phone/views.py
@@ -200,7 +200,7 @@ def take_line(request):
try:
payload = json.loads(request.body)
assert isinstance(payload, dict), 'payload is not a JSON object'
- assert payload.keys() == ['callee'], 'payload must have only one key: callee'
+ assert list(payload.keys()) == ['callee'], 'payload must have only one key: callee'
except (TypeError, ValueError, AssertionError) as e:
return HttpResponseBadRequest(json.dumps({'err': 1, 'msg':
force_text(e)}),
@@ -221,7 +221,7 @@ def release_line(request):
try:
payload = json.loads(request.body)
assert isinstance(payload, dict), 'payload is not a JSON object'
- assert payload.keys() == ['callee'], 'payload must have only one key: callee'
+ assert list(payload.keys()) == ['callee'], 'payload must have only one key: callee'
except (TypeError, ValueError, AssertionError) as e:
return HttpResponseBadRequest(json.dumps({'err': 1, 'msg':
force_text(e)}),