diff --git a/musician/api.py b/musician/api.py index 178012e..1149eaa 100644 --- a/musician/api.py +++ b/musician/api.py @@ -131,32 +131,13 @@ class Orchestra(object): return self.request("PUT", url=url, data=data) def retrieve_mail_address_list(self, querystring=None): - def get_mailbox_id(value): - mailboxes = value.get('mailboxes') - - # forwarded address should not grouped - if len(mailboxes) == 0: - return value.get('name') - - return mailboxes[0]['id'] - # retrieve mails applying filters (if any) raw_data = self.retrieve_service_list( Address.api_name, querystring=querystring, ) - # group addresses with the same mailbox - addresses = [] - for key, group in groupby(raw_data, get_mailbox_id): - aliases = [] - data = {} - for thing in group: - aliases.append(thing.pop('name')) - data = thing - - data['names'] = aliases - addresses.append(Address.new_from_json(data)) + addresses = [Address.new_from_json(data) for data in raw_data] # PATCH to include Pangea addresses not shown by orchestra # described on issue #4 diff --git a/musician/models.py b/musician/models.py index 9e9a31e..3c86283 100644 --- a/musician/models.py +++ b/musician/models.py @@ -265,10 +265,6 @@ class Address(OrchestraModel): def full_address_name(self): return "{}@{}".format(self.name, self.domain['name']) - @property - def mail_address(self): - return self.data['names'][0] + '@' + self.data['domain']['name'] - @property def type(self): if self.data['forward']: diff --git a/musician/templates/musician/addresses.html b/musician/templates/musician/addresses.html index 4f6bf5c..8d52e06 100644 --- a/musician/templates/musician/addresses.html +++ b/musician/templates/musician/addresses.html @@ -21,11 +21,12 @@
{% for obj in object_list %}{{ service.description }}
{% with request.resolver_match.url_name as url_name %}