Ankush Sharma has proposed merging lp:~black-perl/mailman/fix-mailman into 
lp:mailman.

Requested reviews:
  Mailman Coders (mailman-coders)
Related bugs:
  Bug #1425359 in GNU Mailman: "500 error code shown by postorius instead of 
409 error code"
  https://bugs.launchpad.net/mailman/+bug/1425359

For more details, see:
https://code.launchpad.net/~black-perl/mailman/fix-mailman/+merge/251709

Discussed here 
https://mail.python.org/pipermail/mailman-developers/2015-March/024474.html 
about  the bug and its fix.
Added test to call mailman REST api using case sensitive email address in 
'test_try_to_join_a_list_twice' method.
-- 
Your team Mailman Coders is requested to review the proposed merge of 
lp:~black-perl/mailman/fix-mailman into lp:mailman.
=== modified file 'src/mailman/app/membership.py'
--- src/mailman/app/membership.py	2015-01-05 01:22:39 +0000
+++ src/mailman/app/membership.py	2015-03-04 09:46:29 +0000
@@ -98,7 +98,7 @@
     else:
         # The user exists and is linked to the address.
         for address in user.addresses:
-            if address.email == email:
+            if address.email == email.lower():
                 break
         else:
             raise AssertionError(

=== modified file 'src/mailman/rest/tests/test_membership.py'
--- src/mailman/rest/tests/test_membership.py	2015-01-05 01:40:47 +0000
+++ src/mailman/rest/tests/test_membership.py	2015-03-04 09:46:29 +0000
@@ -98,6 +98,15 @@
         self.assertEqual(cm.exception.code, 409)
         self.assertEqual(cm.exception.reason, b'Member already subscribed')
 
+        # Member subscription using case sensitive email
+        with self.assertRaises(HTTPError) as cm:
+            call_api('http://localhost:9001/3.0/members', {
+                'list_id': 'test.example.com',
+                'subscriber': 'a...@example.com',
+                })
+        self.assertEqual(cm.exception.code, 409)
+        self.assertEqual(cm.exception.reason, b'Member already subscribed')
+
     def test_join_with_invalid_delivery_mode(self):
         with self.assertRaises(HTTPError) as cm:
             call_api('http://localhost:9001/3.0/members', {

_______________________________________________
Mailman-coders mailing list
Mailman-coders@python.org
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to