From a9c59edbf2454317210fa14c245662845425c26d Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 27 Sep 2021 13:17:49 +0200 Subject: [PATCH] Fix MailForm after encapsulate Mailbox service --- musician/forms.py | 2 +- musician/models.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/musician/forms.py b/musician/forms.py index 1302fb2..076898d 100644 --- a/musician/forms.py +++ b/musician/forms.py @@ -40,7 +40,7 @@ class MailForm(forms.Form): super().__init__(*args, **kwargs) 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): cleaned_data = super().clean() diff --git a/musician/models.py b/musician/models.py index 9e62d51..a470a65 100644 --- a/musician/models.py +++ b/musician/models.py @@ -301,10 +301,12 @@ class Mailbox(OrchestraModel): description = _('Description details for mailbox page.') fields = ('name', 'filtering', 'addresses', 'active') param_defaults = { + 'id': None, 'name': None, 'filtering': None, 'is_active': True, 'addresses': [], + 'url': None, } @classmethod