diff options
Diffstat (limited to 'src/mailman_pgp/workflows/base.py')
| -rw-r--r-- | src/mailman_pgp/workflows/base.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mailman_pgp/workflows/base.py b/src/mailman_pgp/workflows/base.py index 8a8126a..4ca1525 100644 --- a/src/mailman_pgp/workflows/base.py +++ b/src/mailman_pgp/workflows/base.py @@ -18,6 +18,7 @@ """""" from mailman.email.message import UserNotification from mailman.interfaces.subscriptions import TokenOwner +from mailman.workflows.common import WhichSubscriber from pgpy import PGPKey from mailman_pgp.model.address import PGPAddress @@ -63,11 +64,12 @@ class PubkeyMixin: self.pubkey = None def _step_pubkey_checks(self): + self.push('restore_subscriber') if not self.pubkey: self.push('send_key_request') else: if not self.pubkey_confirmed: - self.push('send_confirm_request') + self.push('send_key_confirm_request') def _step_send_key_request(self): self._set_token(TokenOwner.subscriber) @@ -92,11 +94,11 @@ class PubkeyMixin: else: self.pubkey = pgp_address.key if not self.pubkey_confirmed: - self.push('send_confirm_request') + self.push('send_key_confirm_request') - def _step_send_confirm_request(self): + def _step_send_key_confirm_request(self): self._set_token(TokenOwner.subscriber) - self.push('receive_confirmation') + self.push('receive_key_confirmation') self.save() request_address = self.mlist.request_address email_address = self.address.email @@ -114,5 +116,12 @@ class PubkeyMixin: msg.send(self.mlist) raise StopIteration - def _step_receive_confirmation(self): + def _step_receive_key_confirmation(self): 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 |
