← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/loggerhead-reject-no-sreg into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/loggerhead-reject-no-sreg into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1108261 in Launchpad itself: "NoneType' object is unsubscriptable"
  https://bugs.launchpad.net/launchpad/+bug/1108261

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/loggerhead-reject-no-sreg/+merge/145760

If the sreg_info is None, log and raise a 401, rather than OOPSing.
-- 
https://code.launchpad.net/~stevenk/launchpad/loggerhead-reject-no-sreg/+merge/145760
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/loggerhead-reject-no-sreg into lp:launchpad.
=== modified file 'lib/launchpad_loggerhead/app.py'
--- lib/launchpad_loggerhead/app.py	2012-08-15 20:57:12 +0000
+++ lib/launchpad_loggerhead/app.py	2013-01-31 01:19:22 +0000
@@ -138,7 +138,11 @@
         if response.status == SUCCESS:
             self.log.error('open id response: SUCCESS')
             sreg_info = SRegResponse.fromSuccessResponse(response)
-            print sreg_info
+            if not sreg_info:
+                self.log.error('sreg_info is None.')
+                exc = HTTPUnauthorized()
+                exc.explanation = "Can not link OpenID to Launchpad account."
+                raise exc
             environ[self.session_var]['user'] = sreg_info['nickname']
             raise HTTPMovedPermanently(query['back_to'])
         elif response.status == FAILURE:


Follow ups