aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-07-12 22:52:57 +0200
committerJ08nY2017-07-12 22:52:57 +0200
commitce02d5e98feb6dab1a4a8189d109495a41718260 (patch)
tree634628df4dcc42a480f6447b79f9eb80afebb04a
parentd01183610f3df226da76b3f853666e520cf22461 (diff)
downloadmailman-pgp-ce02d5e98feb6dab1a4a8189d109495a41718260.tar.gz
mailman-pgp-ce02d5e98feb6dab1a4a8189d109495a41718260.tar.zst
mailman-pgp-ce02d5e98feb6dab1a4a8189d109495a41718260.zip
-rw-r--r--src/mailman_pgp/workflows/base.py13
-rw-r--r--src/mailman_pgp/workflows/tests/test_base.py4
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()