Merge lp:~abompard/mailman/subpolicy into lp:~barry/mailman/subpolicy-2

Proposed by Aurélien Bompard
Status: Rejected
Rejected by: Barry Warsaw
Proposed branch: lp:~abompard/mailman/subpolicy
Merge into: lp:~barry/mailman/subpolicy-2
Diff against target: 62 lines (+15/-3)
4 files modified
src/mailman/app/subscriptions.py (+1/-1)
src/mailman/app/tests/test_subscriptions.py (+0/-1)
src/mailman/model/tests/test_workflow.py (+10/-0)
src/mailman/model/workflow.py (+4/-1)
To merge this branch: bzr merge lp:~abompard/mailman/subpolicy
Reviewer Review Type Date Requested Status
Barry Warsaw Disapprove
Review via email: mp+255904@code.launchpad.net

Description of the change

A couple of minor changes. The rest looks good, but I have questions on the "self.token" value that we need to generate for the SubscriptionWorkflow class.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Thanks, but I think this isn't relevant to the current state of the branch.

review: Disapprove

Unmerged revisions

7329. By Aurelien Bompard <email address hidden>

Make sure stored state is deleted after restoring

7328. By Aurelien Bompard <email address hidden>

Fix a failing test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/mailman/app/subscriptions.py'
--- src/mailman/app/subscriptions.py 2015-04-10 02:44:42 +0000
+++ src/mailman/app/subscriptions.py 2015-04-10 23:32:59 +0000
@@ -164,7 +164,7 @@
164 hold_subscription(self.mlist, request)164 hold_subscription(self.mlist, request)
165165
166 def _step_send_confirmation(self):166 def _step_send_confirmation(self):
167 self._next.append('moderation_check')167 self._next.append('moderation_checks')
168 self.save()168 self.save()
169 self._next.clear() # stop iteration until we get confirmation169 self._next.clear() # stop iteration until we get confirmation
170 # XXX: create the Pendable, send the ConfirmationNeededEvent170 # XXX: create the Pendable, send the ConfirmationNeededEvent
171171
=== modified file 'src/mailman/app/tests/test_subscriptions.py'
--- src/mailman/app/tests/test_subscriptions.py 2015-04-10 02:44:42 +0000
+++ src/mailman/app/tests/test_subscriptions.py 2015-04-10 23:32:59 +0000
@@ -372,7 +372,6 @@
372 SubscriptionPolicy.confirm_then_moderate372 SubscriptionPolicy.confirm_then_moderate
373 _do_check()373 _do_check()
374374
375 @unittest.expectedFailure
376 def test_confirmation_required(self):375 def test_confirmation_required(self):
377 # Tests subscriptions where user confirmation is required376 # Tests subscriptions where user confirmation is required
378 self._mlist.subscription_policy = \377 self._mlist.subscription_policy = \
379378
=== modified file 'src/mailman/model/tests/test_workflow.py'
--- src/mailman/model/tests/test_workflow.py 2015-03-29 21:14:09 +0000
+++ src/mailman/model/tests/test_workflow.py 2015-04-10 23:32:59 +0000
@@ -24,6 +24,7 @@
2424
25import unittest25import unittest
2626
27from mailman.config import config
27from mailman.interfaces.workflow import IWorkflowStateManager28from mailman.interfaces.workflow import IWorkflowStateManager
28from mailman.testing.layers import ConfigLayer29from mailman.testing.layers import ConfigLayer
29from zope.component import getUtility30from zope.component import getUtility
@@ -108,3 +109,12 @@
108 self._manager.save(name, key)109 self._manager.save(name, key)
109 workflow = self._manager.restore('ewe', 'fly')110 workflow = self._manager.restore('ewe', 'fly')
110 self.assertIsNone(workflow)111 self.assertIsNone(workflow)
112
113 def test_restore_cleanup(self):
114 # After restoring, stale data must be deleted from the database
115 name = 'ant'
116 key = 'bee'
117 self._manager.save(name, key)
118 self.assertIsNotNone(self._manager.restore(name, key))
119 config.db.store.flush() # there's some caching involved
120 self.assertIsNone(self._manager.restore(name, key))
111121
=== modified file 'src/mailman/model/workflow.py'
--- src/mailman/model/workflow.py 2015-03-29 21:14:09 +0000
+++ src/mailman/model/workflow.py 2015-04-10 23:32:59 +0000
@@ -62,4 +62,7 @@
62 @dbconnection62 @dbconnection
63 def restore(self, store, name, key):63 def restore(self, store, name, key):
64 """See `IWorkflowStateManager`."""64 """See `IWorkflowStateManager`."""
65 return store.query(WorkflowState).get((name, key))65 state = store.query(WorkflowState).get((name, key))
66 if state is not None:
67 store.delete(state)
68 return state

Subscribers

People subscribed via source and target branches