aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/workflows/key_change.py
diff options
context:
space:
mode:
authorJ08nY2017-08-06 02:51:44 +0200
committerJ08nY2017-08-06 02:51:44 +0200
commit009a60e504f9441aace4a490bfe811d0471e2dfd (patch)
tree865f9ccf63f2118a0262dacab508e99a4f316894 /src/mailman_pgp/workflows/key_change.py
parentb56debf2d3db0732e6fa4a3d22ecaaae78fc5b65 (diff)
downloadmailman-pgp-009a60e504f9441aace4a490bfe811d0471e2dfd.tar.gz
mailman-pgp-009a60e504f9441aace4a490bfe811d0471e2dfd.tar.zst
mailman-pgp-009a60e504f9441aace4a490bfe811d0471e2dfd.zip
Refactor some stuff into PGPMixin.
Diffstat (limited to 'src/mailman_pgp/workflows/key_change.py')
-rw-r--r--src/mailman_pgp/workflows/key_change.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mailman_pgp/workflows/key_change.py b/src/mailman_pgp/workflows/key_change.py
index fce7b71..b2fac65 100644
--- a/src/mailman_pgp/workflows/key_change.py
+++ b/src/mailman_pgp/workflows/key_change.py
@@ -28,10 +28,9 @@ from zope.interface import implementer
from mailman_pgp.config import config
from mailman_pgp.database import transaction
-from mailman_pgp.model.address import PGPAddress
-from mailman_pgp.model.list import PGPMailingList
from mailman_pgp.pgp.wrapper import PGPWrapper
from mailman_pgp.utils.email import copy_headers
+from mailman_pgp.workflows.base import PGPMixin
from mailman_pgp.workflows.mod_approval import (
ModeratorKeyChangeApprovalMixin)
@@ -48,29 +47,18 @@ Token: {}
"""
-class KeyChangeBase(Workflow):
+class KeyChangeBase(Workflow, PGPMixin):
save_attributes = (
'address_key',
'pubkey_key'
)
def __init__(self, mlist, pgp_address=None, pubkey=None):
- super().__init__()
- self.mlist = mlist
- self.pgp_list = PGPMailingList.for_list(mlist)
- self.pgp_address = pgp_address
+ Workflow.__init__(self)
+ PGPMixin.__init__(self, mlist, pgp_address)
self.pubkey = pubkey
@property
- def address_key(self):
- return self.pgp_address.email
-
- @address_key.setter
- def address_key(self, value):
- self.pgp_address = PGPAddress.for_email(value)
- self.member = self.mlist.regular_members.get_member(value)
-
- @property
def pubkey_key(self):
return str(self.pubkey)