aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/workflows/base.py
diff options
context:
space:
mode:
authorJ08nY2017-07-11 20:24:33 +0200
committerJ08nY2017-07-11 20:48:22 +0200
commit97abc15b2e92fcf9109997043e4297f16d0bf5c7 (patch)
treea7f681a04f7723d0a638661276aabeb08aed74bf /src/mailman_pgp/workflows/base.py
parent90d8ab005fede36adf66cf1a042ef33a3ece4c8d (diff)
downloadmailman-pgp-97abc15b2e92fcf9109997043e4297f16d0bf5c7.tar.gz
mailman-pgp-97abc15b2e92fcf9109997043e4297f16d0bf5c7.tar.zst
mailman-pgp-97abc15b2e92fcf9109997043e4297f16d0bf5c7.zip
Diffstat (limited to 'src/mailman_pgp/workflows/base.py')
-rw-r--r--src/mailman_pgp/workflows/base.py19
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