Commit 7050985f authored by Florian Fuchs's avatar Florian Fuchs

Added some changes from the core API

parent 3baea2f5
......@@ -200,13 +200,12 @@ class Client:
def create_domain(self, mail_host, base_url=None,
description=None, contact_address=None):
# `contact_address` is deprecated but still accepted.
data = dict(mail_host=mail_host)
if base_url is not None:
data['base_url'] = base_url
if description is not None:
data['description'] = description
if contact_address is not None:
data['contact_address'] = contact_address
response, content = self._connection.call('domains', data)
return _Domain(self._connection, response['location'])
......@@ -435,7 +434,8 @@ class _List:
else:
entries = []
for entry in content['entries']:
request = dict(address=entry['address'],
request = dict(email=entry['email'],
address=entry['email'], # Deprecated.
delivery_mode=entry['delivery_mode'],
display_name=entry['display_name'],
language=entry['language'],
......
......@@ -41,14 +41,11 @@ must be added. By default, there are no known domains.
It's easy to create a new domain; when you do, a proxy object for that domain
is returned.
>>> example_dot_com = client.create_domain('example.com',
... contact_address='admin@example.com')
>>> example_dot_com = client.create_domain('example.com')
>>> example_dot_com
<Domain "example.com">
>>> print(example_dot_com.base_url)
http://example.com
>>> print(example_dot_com.contact_address)
admin@example.com
>>> print(example_dot_com.description)
None
>>> print(example_dot_com.mail_host)
......@@ -278,7 +275,7 @@ A membership has preferences.
>>> print(prefs['hide_address'])
None
>>> print(prefs['preferred_language'])
None
en
>>> print(prefs['receive_list_copy'])
None
>>> print(prefs['receive_own_postings'])
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment