Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Do not moderate all members if moderation list is empty #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions Products/GSGroup/mailinglistinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ def get_moderatees(self):
""" Find and return all moderated members as a list of userInfo objects.
The userIds of specified moderated members are assumed to be stored in a
property called 'moderated_members' of type 'lines'.
If this property does not exist or does not contain any userIds, then
there are two possibilities: either no members are moderated, or all
group members (other than administrators, moderators and the ptn coach)
are moderated.
The deciding factor is whether 'Moderate New Members' is on:
- If so, then it is assumed that *no members* are being moderated.
- If not, then it is assumed that *all normal members* are moderated.
"""
members = []
if self.is_moderated:
Expand All @@ -116,12 +109,13 @@ def get_moderatees(self):
members = \
[ createObject('groupserver.UserFromId', self.context, uid)
for uid in moderated_ids if uid in memberIds ]
elif not(self.is_moderate_new):
members = \
[ u for u in group_members
if (not(user_admin_of_group(u, self.groupInfo))
and not(user_participation_coach_of_group(u, self.groupInfo)
and (u not in self.moderators) and (u not in self.blocked_members))) ]
#We do not want to moderate all members
#elif not(self.is_moderate_new):
# members = \
# [ u for u in group_members
# if (not(user_admin_of_group(u, self.groupInfo))
# and not(user_participation_coach_of_group(u, self.groupInfo)
# and (u not in self.moderators) and (u not in self.blocked_members))) ]
members.sort(sort_by_name)
assert type(members) == list
return members
Expand Down