diff options
| author | J08nY | 2017-08-18 18:59:54 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-18 18:59:54 +0200 |
| commit | 9d23d95ca530f5eabcd0f1c50d18dea2dc29b506 (patch) | |
| tree | 850df69361e0a71bbd6596ec1b213db2a0ab1b2a /src/django_pgpmailman/models.py | |
| parent | 4207a3f3ee3288b02c91808935976f0b8006eb14 (diff) | |
| download | django-pgpmailman-9d23d95ca530f5eabcd0f1c50d18dea2dc29b506.tar.gz django-pgpmailman-9d23d95ca530f5eabcd0f1c50d18dea2dc29b506.tar.zst django-pgpmailman-9d23d95ca530f5eabcd0f1c50d18dea2dc29b506.zip | |
Diffstat (limited to 'src/django_pgpmailman/models.py')
| -rw-r--r-- | src/django_pgpmailman/models.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/django_pgpmailman/models.py b/src/django_pgpmailman/models.py index 406ae76..0a49475 100644 --- a/src/django_pgpmailman/models.py +++ b/src/django_pgpmailman/models.py @@ -23,7 +23,6 @@ from itertools import chain from mailmanclient._client import MailingList, RESTObject from pgpy import PGPKey from pgpy.errors import PGPError -from six.moves.urllib_error import HTTPError class PGPMailingList(RESTObject): @@ -51,11 +50,8 @@ class PGPMailingList(RESTObject): @key.setter def key(self, value): str_key = str(value) if value else '' - try: - self._connection.call(self._url + '/key', data=dict(key=str_key), - method='PUT') - except HTTPError: - pass + self._connection.call(self._url + '/key', data=dict(key=str_key), + method='PUT') @property def pubkey(self): @@ -65,3 +61,10 @@ class PGPMailingList(RESTObject): return key except PGPError: return None + + @pubkey.setter + def pubkey(self, value): + str_key = str(value) if value else '' + self._connection.call(self._url + '/pubkey', + data=dict(public_key=str_key), + method='PUT') |
