aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/workflows/key_change.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/workflows/key_change.py')
-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: