← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-810626 into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-810626 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #810626 in Launchpad itself: "launchpad should mark required sreg attributes  as required"
  https://bugs.launchpad.net/launchpad/+bug/810626

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-810626/+merge/68043

As reported in bug #810626, SSO is about to start allowing users to refuse to send optionally requested data. This branch fixes LP to mark fullname and email as required, so they are always sent.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-810626/+merge/68043
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-810626 into lp:launchpad.
=== modified file 'lib/canonical/launchpad/webapp/login.py'
--- lib/canonical/launchpad/webapp/login.py	2011-06-10 18:34:34 +0000
+++ lib/canonical/launchpad/webapp/login.py	2011-07-15 00:24:31 +0000
@@ -207,7 +207,7 @@
         finally:
             timeline_action.finish()
         self.openid_request.addExtension(
-            sreg.SRegRequest(optional=['email', 'fullname']))
+            sreg.SRegRequest(required=['email', 'fullname']))
 
         assert not self.openid_request.shouldSendRedirect(), (
             "Our fixed OpenID server should not need us to redirect.")

=== modified file 'lib/canonical/launchpad/webapp/tests/test_login.py'
--- lib/canonical/launchpad/webapp/tests/test_login.py	2011-06-10 18:34:34 +0000
+++ lib/canonical/launchpad/webapp/tests/test_login.py	2011-07-15 00:24:31 +0000
@@ -699,6 +699,8 @@
         self.assertIsInstance(sreg_extension, sreg.SRegRequest)
         self.assertEquals(['email', 'fullname'],
                           sorted(sreg_extension.allRequestedFields()))
+        self.assertEquals(sorted(sreg_extension.required),
+                          sorted(sreg_extension.allRequestedFields()))
 
     def test_logs_to_timeline(self):
         # Beginning an OpenID association makes an HTTP request to the