Fix MailForm after encapsulate Mailbox service

This commit is contained in:
Santiago L 2021-09-27 13:17:49 +02:00
parent 0246d0a22e
commit a9c59edbf2
2 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class MailForm(forms.Form):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields['domain'].choices = [(d.url, d.name) for d in domains] self.fields['domain'].choices = [(d.url, d.name) for d in domains]
self.fields['mailboxes'].choices = [(m['url'], m['name']) for m in mailboxes] self.fields['mailboxes'].choices = [(m.url, m.name) for m in mailboxes]
def clean(self): def clean(self):
cleaned_data = super().clean() cleaned_data = super().clean()

View File

@ -301,10 +301,12 @@ class Mailbox(OrchestraModel):
description = _('Description details for mailbox page.') description = _('Description details for mailbox page.')
fields = ('name', 'filtering', 'addresses', 'active') fields = ('name', 'filtering', 'addresses', 'active')
param_defaults = { param_defaults = {
'id': None,
'name': None, 'name': None,
'filtering': None, 'filtering': None,
'is_active': True, 'is_active': True,
'addresses': [], 'addresses': [],
'url': None,
} }
@classmethod @classmethod