Author: rmarianski
Date: 2007-11-14 11:48:25 -0500 (Wed, 14 Nov 2007)
New Revision: 11005
Modified:
opencore/branches/rb-0.9.7.3/opencore/listen/events.py
opencore/branches/rb-0.9.7.3/opencore/listen/listen_discussion.txt
Log:
silently fail on adding/removing memberships if the default discussion list
does not exist #1555
Modified: opencore/branches/rb-0.9.7.3/opencore/listen/events.py
===================================================================
--- opencore/branches/rb-0.9.7.3/opencore/listen/events.py 2007-11-14
16:47:07 UTC (rev 11004)
+++ opencore/branches/rb-0.9.7.3/opencore/listen/events.py 2007-11-14
16:48:25 UTC (rev 11005)
@@ -47,8 +47,8 @@
try:
ml = portal.projects._getOb(proj_id).lists._getOb(default_list_name)
except AttributeError:
- #XXX just raising an error if default list doesn't exist
- raise ValueError("no default project discussion list for '%s'" %
proj_id)
+ # somebody could have removed the default mailing list
+ # silently fail
return
memlist = IWriteMembershipList(ml)
getattr(memlist, action)(mem_id)
Modified: opencore/branches/rb-0.9.7.3/opencore/listen/listen_discussion.txt
===================================================================
--- opencore/branches/rb-0.9.7.3/opencore/listen/listen_discussion.txt
2007-11-14 16:47:07 UTC (rev 11004)
+++ opencore/branches/rb-0.9.7.3/opencore/listen/listen_discussion.txt
2007-11-14 16:48:25 UTC (rev 11005)
@@ -73,6 +73,30 @@
>>> mem_list.subscribers
['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
+If we remove the mailing list, and remove a member
+It should fail silently
+
+Remove the mailing list
+ >>> lists_folder.manage_delObjects(['p3-discussion'])
+ >>> lists_folder._getOb('p3-discussion')
+ Traceback (most recent call last):
+ ...
+ AttributeError: p3-discussion
+
+Simulate a member leaving
+ >>> wft.doActionFor(mship2, 'deactivate')
+ >>> member_joined_project(mship2, evt)
+
+No change
+ >>> mem_list.subscribers
+ ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
+
+Try to add himself again
+No action should happen
+ >>> member_left_project(mship2, None)
+ >>> mem_list.subscribers
+ ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
+
Finally, if we remove the mailing list featurelet for the project,
the lists folder should no longer exist
First, remove the featurelet from the project
--
Archive:
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2007/11/1195058906033
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]
Please contact [EMAIL PROTECTED] for questions.