diff options
| -rw-r--r-- | src/mailman_pgp/workflows/base.py | 13 | ||||
| -rw-r--r-- | src/mailman_pgp/workflows/tests/test_base.py | 4 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/mailman_pgp/workflows/base.py b/src/mailman_pgp/workflows/base.py index 1e6b867..3c276cf 100644 --- a/src/mailman_pgp/workflows/base.py +++ b/src/mailman_pgp/workflows/base.py @@ -64,8 +64,6 @@ class PubkeyMixin: self.pubkey = None def _step_pubkey_checks(self): - self.push('restore_subscriber') - pgp_address = PGPAddress.for_address(self.address) if pgp_address is not None: @@ -95,6 +93,9 @@ class PubkeyMixin: raise StopIteration def _step_receive_key(self): + self._restore_subscriber() + self._set_token(TokenOwner.no_one) + pgp_address = PGPAddress.for_address(self.address) if pgp_address is None or pgp_address.key is None: # The workflow was confirmed but we still dont have an address @@ -126,11 +127,5 @@ class PubkeyMixin: raise StopIteration def _step_receive_key_confirmation(self): + self._restore_subscriber() self._set_token(TokenOwner.no_one) - - def _step_restore_subscriber(self): - if self.which is WhichSubscriber.address: - self.subscriber = self.address - else: - assert self.which is WhichSubscriber.user - self.subscriber = self.user diff --git a/src/mailman_pgp/workflows/tests/test_base.py b/src/mailman_pgp/workflows/tests/test_base.py index 5b07e5b..ef3a009 100644 --- a/src/mailman_pgp/workflows/tests/test_base.py +++ b/src/mailman_pgp/workflows/tests/test_base.py @@ -88,7 +88,6 @@ class TestPubkeyMixin(unittest.TestCase): pubkey=self.sender_key.pubkey, pubkey_pre_confirmed=True) workflow.run_thru('pubkey_checks') - next(workflow) with patch.object(workflow, '_step_do_subscription') as step: next(workflow) step.assert_called_once_with() @@ -148,7 +147,6 @@ class TestPubkeyMixin(unittest.TestCase): receive_workflow.token = workflow.token receive_workflow.restore() receive_workflow.run_thru('receive_key') - next(receive_workflow) with patch.object(receive_workflow, '_step_do_subscription') as step: next(receive_workflow) step.assert_called_once_with() @@ -185,7 +183,6 @@ class TestPubkeyMixin(unittest.TestCase): receive_workflow.token = workflow.token receive_workflow.restore() receive_workflow.run_thru('receive_key_confirmation') - next(receive_workflow) with patch.object(receive_workflow, '_step_do_subscription') as step: next(receive_workflow) step.assert_called_once_with() @@ -202,7 +199,6 @@ class TestPubkeyMixin(unittest.TestCase): t.add(pgp_address) workflow.run_thru('pubkey_checks') - next(workflow) with patch.object(workflow, '_step_do_subscription') as step: next(workflow) step.assert_called_once_with() |
