summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--welco/sources/phone/views.py6
-rw-r--r--welco/views.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/welco/sources/phone/views.py b/welco/sources/phone/views.py
index ab9dac4..f04341f 100644
--- a/welco/sources/phone/views.py
+++ b/welco/sources/phone/views.py
@@ -96,7 +96,7 @@ def call_event(request):
assert isinstance(payload['callee'], six.string_types), 'callee must be a string'
if 'data' in payload:
assert isinstance(payload['data'], dict), 'data must be a JSON object'
- except (TypeError, ValueError, AssertionError), e:
+ except (TypeError, ValueError, AssertionError) as e:
return HttpResponseBadRequest(json.dumps({'err': 1, 'msg':
force_text(e)}),
content_type='application/json')
@@ -201,7 +201,7 @@ def take_line(request):
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'
- except (TypeError, ValueError, AssertionError), e:
+ except (TypeError, ValueError, AssertionError) as e:
return HttpResponseBadRequest(json.dumps({'err': 1, 'msg':
force_text(e)}),
content_type='application/json')
@@ -222,7 +222,7 @@ def release_line(request):
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'
- except (TypeError, ValueError, AssertionError), e:
+ except (TypeError, ValueError, AssertionError) as e:
return HttpResponseBadRequest(json.dumps({'err': 1, 'msg':
force_text(e)}),
content_type='application/json')
diff --git a/welco/views.py b/welco/views.py
index 2efa6f3..bcd284f 100644
--- a/welco/views.py
+++ b/welco/views.py
@@ -180,7 +180,7 @@ def create_formdata(request, *args, **kwargs):
qualif = Association.objects.get(id=kwargs.get('pk'))
try:
qualif.push(request)
- except Exception, e:
+ except Exception as e:
json.dump({'err': 1, 'msg': str(e)}, response)
return response
json.dump({'result': 'ok', 'url': qualif.formdata_url}, response)