aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/workflows
diff options
context:
space:
mode:
authorJ08nY2017-07-14 00:37:40 +0200
committerJ08nY2017-07-14 00:37:40 +0200
commit8368cd832d21b404c01ab475ade6209b906ab422 (patch)
treedc0e6b5452ec3d80bef493d8518757a513791eca /src/mailman_pgp/workflows
parent57f8d97c696913beeba8467aa550804422336d9c (diff)
downloadmailman-pgp-8368cd832d21b404c01ab475ade6209b906ab422.tar.gz
mailman-pgp-8368cd832d21b404c01ab475ade6209b906ab422.tar.zst
mailman-pgp-8368cd832d21b404c01ab475ade6209b906ab422.zip
Diffstat (limited to 'src/mailman_pgp/workflows')
-rw-r--r--src/mailman_pgp/workflows/key_change.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mailman_pgp/workflows/key_change.py b/src/mailman_pgp/workflows/key_change.py
index 8831d28..a67edbb 100644
--- a/src/mailman_pgp/workflows/key_change.py
+++ b/src/mailman_pgp/workflows/key_change.py
@@ -25,6 +25,7 @@ from public import public
from zope.component import getUtility
from zope.interface import implementer
+from mailman_pgp.database import transaction
from mailman_pgp.model.address import PGPAddress
from mailman_pgp.pgp.utils import copy_headers
from mailman_pgp.pgp.wrapper import PGPWrapper
@@ -84,11 +85,12 @@ class KeyChangeWorkflow(Workflow):
pendings = getUtility(IPendings)
pendable = KeyChangeWorkflow.pendable_class()(
email=self.pgp_address.email,
- pubkey=str(self.pubkey)
+ pubkey=str(self.pubkey),
+ fingerprint=self.pubkey.fingerprint
)
self.token = pendings.add(pendable)
- self.push('receive_key_confirmation')
+ self.push('receive_confirmation')
self.save()
request_address = self.mlist.request_address
email_address = self.pgp_address.email
@@ -106,8 +108,9 @@ class KeyChangeWorkflow(Workflow):
raise StopIteration
def _step_receive_confirmation(self):
- self.pgp_address.key = self.pubkey
- self.pgp_address.key_confirmed = True
+ with transaction():
+ self.pgp_address.key = self.pubkey
+ self.pgp_address.key_confirmed = True
pendings = getUtility(IPendings)
if self.token is not None: