From b6df3c3cdcb4ca25b48cc316502ec39482afe20e Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 11 Aug 2017 20:29:28 +0200 Subject: Add pubkey view for downloading list pubkey. --- src/django_pgpmailman/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/django_pgpmailman/models.py') diff --git a/src/django_pgpmailman/models.py b/src/django_pgpmailman/models.py index f396e73..8b8dbdd 100644 --- a/src/django_pgpmailman/models.py +++ b/src/django_pgpmailman/models.py @@ -15,6 +15,9 @@ # # You should have received a copy of the GNU General Public License along with # this program. If not, see . + +from __future__ import absolute_import, unicode_literals + from itertools import chain from mailmanclient._client import RESTObject, MailingList @@ -30,7 +33,7 @@ class PGPMailingList(RESTObject): 'strip_original_sig', 'sign_outgoing', 'nonencrypted_msg_action', 'encrypt_outgoing', 'key_change_workflow', 'key_signing_allowed') _read_only_properties = ('self_link', 'list_id') - _properties = chain(_writable_properties, _read_only_properties) + _properties = list(chain(_writable_properties, _read_only_properties)) @property def mlist(self): @@ -40,7 +43,7 @@ class PGPMailingList(RESTObject): def key(self): try: response, content = self._connection.call(self._url + '/key') - key, _ = PGPKey.from_blob(response['key']) + key, _ = PGPKey.from_blob(content['key']) return key except PGPError: return None @@ -58,7 +61,7 @@ class PGPMailingList(RESTObject): def pubkey(self): try: response, content = self._connection.call(self._url + '/pubkey') - key, _ = PGPKey.from_blob(response['key']) + key, _ = PGPKey.from_blob(content['public_key']) return key except PGPError: return None -- cgit v1.2.3-70-g09d2