tomlikestorock/pyramid_openid — Issue #6: [PATCH] Fix for cancelled request
Author: machalekj
Created: 2011-11-25 14:29:05+00:00
State: open

Hi, thanks for nice and useful piece of code. I just fixed a cancelled login form so now it redirects to openid.error_destination instead of returning HTTPBadRequest:

---
pyramid_openid/view.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/pyramid_openid/view.py b/pyramid_openid/view.py
index 0389c1a..ca6188d 100644
--- a/pyramid_openid/view.py
+++ b/pyramid_openid/view.py
@@ -69,6 +69,8 @@ def verify_openid(context, request):
return process_incoming_request(context, request, incoming_openid_url)
elif openid_mode == 'id_res':
return process_provider_response(context, request)
+ elif openid_mode == 'cancel':
+ return error_to_login_form(request, 'Login request cancelled')
return HTTPBadRequest()

--
1.7.5.4