Wiking branch, master, updated. cc6478274a5683e32f20fde6d81fe3f3ceae2dbf

Tomas Cerha cerha at devel.brailcom.org
Wed Oct 13 17:12:03 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Wiking".

The branch, master has been updated
       via  cc6478274a5683e32f20fde6d81fe3f3ceae2dbf (commit)
       via  f4cbceed1bf82fa49db5159c6dfaef5a694ed80c (commit)
      from  1bcb969855c1bfbe78f5439d49bb185b53d4de4f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cc6478274a5683e32f20fde6d81fe3f3ceae2dbf
Author: Boris Dusek <dusek at brailcom.org>
Date:   Wed Oct 13 13:25:47 2010 +0200

    Users can now opt in/out of group notifications.

commit f4cbceed1bf82fa49db5159c6dfaef5a694ed80c
Author: Tomas Cerha <cerha at brailcom.org>
Date:   Wed Oct 13 17:08:33 2010 +0200

    Remove the method _export_element_type() which is unnecessary in recent LCG versions.

-----------------------------------------------------------------------

Summary of changes:
 lib/wiking/cms/users.py |   16 +++++++++++++---
 lib/wiking/util.py      |    3 ---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lib/wiking/cms/users.py b/lib/wiking/cms/users.py
index 14382c3..6827415 100644
--- a/lib/wiking/cms/users.py
+++ b/lib/wiking/cms/users.py
@@ -1049,13 +1049,19 @@ class Users(UserManagementModule):
         record.update(password=value.value(), last_password_change=now())
         return password
 
-    def send_mail(self, role, *args, **kwargs):
+    def send_mail(self, role, include_uids=(), exclude_uids=(), *args, **kwargs):
         """Send mail to all active users of given C{role}.
         
         @type role: L{wiking.Role} or sequence of L{wiking.Role}s or C{None}
         @param role: Destination role to send the mail to, all active users
           belonging to the role will receive the mail.  If C{None}, the mail is
           sent to all active users.
+        @type include_uids: iterable of L{wiking.User} uid values.
+        @param include_uids: uid of users that must receive the email even if
+          not members of C{role}.  Must be disjunct with C{exclude_uids}
+        @type exclude_uids: iterable of L{wiking.User} uid values.
+        @param exclude_uids: uid of users that must not receive the email even
+          if members of C{role}.  Must be disjunct with C{include_uids}
         @param args, kwargs: Just forwarded to L{wiking.send_mail} call.
 
         @note: The mail is sent only to active users, i.e. users with the state
@@ -1075,9 +1081,13 @@ class Users(UserManagementModule):
         if role is not None:
             if not is_sequence(role):
                 role = (role,)
-            user_ids = []
+            user_ids = set()
             for r in role:
-                user_ids += self._module('RoleMembers').user_ids(r)
+                user_ids |= set(self._module('RoleMembers').user_ids(r))
+            include_uids = set(include_uids)
+            exclude_uids = set(exclude_uids)
+            user_ids |= include_uids
+            user_ids -= exclude_uids
         user_rows = self._data.get_rows()
         import copy
         kwargs = copy.copy(kwargs)
diff --git a/lib/wiking/util.py b/lib/wiking/util.py
index d407004..dce7dd4 100644
--- a/lib/wiking/util.py
+++ b/lib/wiking/util.py
@@ -1336,9 +1336,6 @@ class LoginDialog(lcg.Content):
 class ConfirmationDialog(lcg.Container):
     """Dialog displaying arbitrary content followed by a `Continue' button."""
     
-    def _export_element_type(self):
-        return lcg.Container
-    
     def export(self, context):
         g = context.generator()
         return g.div((super(ConfirmationDialog, self).export(context),


hooks/post-receive
-- 
Wiking



More information about the Wiking-cvs mailing list