Branch 'pykolab-0.4' - bin/kolab_smtp_access_policy.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Sun Sep 16 20:36:10 CEST 2012


 bin/kolab_smtp_access_policy.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a1a1cba81a1ac4e29f37090c599177f5f5a19d41
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Sun Sep 16 19:35:41 2012 +0100

    Ensure unique recipients in list

diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index bce2614..09420e8 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -183,7 +183,7 @@ class PolicyRequest(object):
 
             else:
                 if not policy_request['recipient'].strip() == '':
-                    self.recipients.append(policy_request['recipient'])
+                    self.recipients = list(set(self.recipients + [policy_request['recipient']]))
 
     def add_request(self, policy_request={}):
         """
@@ -214,7 +214,7 @@ class PolicyRequest(object):
                 )
 
             if not policy_request['recipient'].strip() == '':
-                self.recipients.append(policy_request['recipient'])
+                self.recipients = list(set(self.recipients + [policy_request['recipient']]))
 
     def parse_ldap_dn(self, dn):
         """





More information about the commits mailing list