From 425d090522a5ca41ba2a84f611606c325a4a57a0 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 17 Feb 2020 11:29:58 +0100 Subject: [PATCH] Patch to list pangea mail addresses (#4) --- musician/api.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/musician/api.py b/musician/api.py index 95443b8..7a93081 100644 --- a/musician/api.py +++ b/musician/api.py @@ -137,6 +137,22 @@ class Orchestra(object): data['names'] = aliases addresses.append(MailService.new_from_json(data)) + # PATCH to include Pangea addresses not shown by orchestra + # described on issue #4 + raw_mailboxes = self.retrieve_service_list('mailbox') + for mailbox in raw_mailboxes: + if mailbox['addresses'] == []: + address_data = { + 'names': [mailbox['name']], + 'forward': '', + 'domain': { + 'name': 'pangea.org.', + }, + 'mailboxes': [mailbox], + } + pangea_address = MailService.new_from_json(address_data) + addresses.append(pangea_address) + return addresses def retrieve_domain(self, pk):