aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/workflows/mod_approval.py
diff options
context:
space:
mode:
authorJ08nY2017-08-02 18:55:51 +0200
committerJ08nY2017-08-02 18:55:51 +0200
commit7075b5c47012e57455d6fc610f064b8d690b44cb (patch)
treee337c4f1b42b8ba9fa9d6ff7492ca92f87cc5cb9 /src/mailman_pgp/workflows/mod_approval.py
parent2681a5cd91b2563a24cf41b5dafe491bae6106ab (diff)
downloadmailman-pgp-7075b5c47012e57455d6fc610f064b8d690b44cb.tar.gz
mailman-pgp-7075b5c47012e57455d6fc610f064b8d690b44cb.tar.zst
mailman-pgp-7075b5c47012e57455d6fc610f064b8d690b44cb.zip
Diffstat (limited to 'src/mailman_pgp/workflows/mod_approval.py')
-rw-r--r--src/mailman_pgp/workflows/mod_approval.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mailman_pgp/workflows/mod_approval.py b/src/mailman_pgp/workflows/mod_approval.py
index e7ff061..90edf4c 100644
--- a/src/mailman_pgp/workflows/mod_approval.py
+++ b/src/mailman_pgp/workflows/mod_approval.py
@@ -16,12 +16,14 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
+import copy
from mailman.email.message import UserNotification
from mailman.interfaces.subscriptions import TokenOwner
from public import public
from mailman_pgp.pgp.mime import MIMEWrapper
+from mailman_pgp.utils.email import overwrite_message
MOD_APPROVAL_REQUEST = """\
----------
@@ -37,26 +39,24 @@ Fingerprint: {}
@public
class ModeratorApprovalMixin:
def _step_mod_approval(self):
- self.push('restore')
self.push('get_approval')
def _step_get_approval(self):
- self._set_token(TokenOwner.moderator)
- self.push('restore')
+ self._pend(TokenOwner.moderator)
+ self.push('receive_confirmation')
self.save()
if self.mlist.admin_immed_notify:
- subject = 'New key change request to {} from {}'.format(
- self.mlist.display_name, self.pgp_address.email)
+ subject = 'New key change request from {}'.format(
+ self.pgp_address.email)
text = MOD_APPROVAL_REQUEST.format(self.pgp_address.email,
self.pubkey.fingerprint)
msg = UserNotification(
self.mlist.owner_address, self.mlist.owner_address,
subject, text, self.mlist.preferred_language)
+ out = copy.deepcopy(msg)
wrapped = MIMEWrapper(msg)
msg = wrapped.attach_keys(self.pubkey)
- msg.send(self.mlist)
+ overwrite_message(msg, out)
+ out.send(self.mlist)
raise StopIteration
-
- def _step_restore(self):
- self._set_token(TokenOwner.no_one)