tests/unit wallace/module_invitationpolicy.py

Thomas Brüderli bruederli at kolabsys.com
Thu Feb 12 16:55:33 CET 2015


 tests/unit/test-012-wallace_invitationpolicy.py |    1 +
 wallace/module_invitationpolicy.py              |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6e6cd3c1ae59989c58f7ed809ebd491ab134b2f2
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Feb 11 02:39:39 2015 +0100

    Prevent wallace from failing on bogus configurations (#4555)

diff --git a/tests/unit/test-012-wallace_invitationpolicy.py b/tests/unit/test-012-wallace_invitationpolicy.py
index 20e139d..f51b93e 100644
--- a/tests/unit/test-012-wallace_invitationpolicy.py
+++ b/tests/unit/test-012-wallace_invitationpolicy.py
@@ -122,6 +122,7 @@ class TestWallaceInvitationpolicy(unittest.TestCase):
             'TASK_REJECT:*',
             'EVENT_ACCEPT:example.org',
             'EVENT_REJECT:gmail.com',
+            'ALL_UPDATE:outlook:com',
             'ALL_MANUAL:*'
         ] }
         self.assertEqual(MIP.get_matching_invitation_policies(user, 'a at fastmail.net',   MIP.COND_TYPE_EVENT), [MIP.ACT_MANUAL])
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index 1e94f63..f8c0b8e 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -661,7 +661,7 @@ def get_matching_invitation_policies(receiving_user, sender_email, type_conditio
     matches = []
     for p in policies:
         if ':' in p:
-            (value, domain) = p.split(':')
+            (value, domain) = p.split(':', 1)
         else:
             value = p
             domain = ''




More information about the commits mailing list