Fix Mailbox creation.

Direct assignment to the reverse side of a many-to-many set is
prohibited. Use addresses.set() instead.
This commit is contained in:
Santiago L 2021-05-17 12:54:16 +02:00
parent 13b4ac5eee
commit a6c5aa32df

View file

@ -217,7 +217,7 @@ class MailboxAdmin(ChangePasswordAdminMixin, SelectAccountAdminMixin, ExtendedMo
elif obj.custom_filtering: elif obj.custom_filtering:
messages.warning(request, msg) messages.warning(request, msg)
super(MailboxAdmin, self).save_model(request, obj, form, change) super(MailboxAdmin, self).save_model(request, obj, form, change)
obj.addresses = form.cleaned_data['addresses'] obj.addresses.set(form.cleaned_data['addresses'])
class AddressAdmin(SelectAccountAdminMixin, ExtendedModelAdmin): class AddressAdmin(SelectAccountAdminMixin, ExtendedModelAdmin):