diff options
| author | J08nY | 2017-08-20 22:48:09 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-20 22:48:09 +0200 |
| commit | bfc7f14b1df86834abf395fdbf11ab54f076dca6 (patch) | |
| tree | 4ea3c48c079baf533e625c90a1f77c62f14d5c2c /src/django_pgpmailman/models.py | |
| parent | 9d23d95ca530f5eabcd0f1c50d18dea2dc29b506 (diff) | |
| download | django-pgpmailman-bfc7f14b1df86834abf395fdbf11ab54f076dca6.tar.gz django-pgpmailman-bfc7f14b1df86834abf395fdbf11ab54f076dca6.tar.zst django-pgpmailman-bfc7f14b1df86834abf395fdbf11ab54f076dca6.zip | |
Diffstat (limited to 'src/django_pgpmailman/models.py')
| -rw-r--r-- | src/django_pgpmailman/models.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/django_pgpmailman/models.py b/src/django_pgpmailman/models.py index 0a49475..572e51b 100644 --- a/src/django_pgpmailman/models.py +++ b/src/django_pgpmailman/models.py @@ -20,7 +20,8 @@ from __future__ import absolute_import, unicode_literals from itertools import chain -from mailmanclient._client import MailingList, RESTObject +from mailmanclient import Address, MailingList +from mailmanclient.restbase.base import RESTObject from pgpy import PGPKey from pgpy.errors import PGPError @@ -32,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 = list(chain(_writable_properties, _read_only_properties)) + _properties = tuple(chain(_writable_properties, _read_only_properties)) @property def mlist(self): @@ -68,3 +69,13 @@ class PGPMailingList(RESTObject): self._connection.call(self._url + '/pubkey', data=dict(public_key=str_key), method='PUT') + + +class PGPAddress(RESTObject): + _read_only_properties = ('self_link', 'email', 'key_fingerprint', + 'key_confirmed') + _properties = _read_only_properties + + @property + def address(self): + return Address(self._connection, 'addresses/{}'.format(self.email)) |
