~netlandish/django-wiki

89aa8492e1b83b01f8ff8d599993b512d6f16bf3 — Benjamin Bach 6 years ago 5918949 + fc8c3de
Merge pull request #800 from atombrella/django_15

Removed Django < 1.5 guard for list/QuerySet in SettingsModelForm.save.
1 files changed, 1 insertions(+), 4 deletions(-)

M src/wiki/plugins/notifications/forms.py
M src/wiki/plugins/notifications/forms.py => src/wiki/plugins/notifications/forms.py +1 -4
@@ 62,10 62,7 @@ class SettingsModelForm(forms.ModelForm):
    def save(self, *args, **kwargs):
        instance = super().save(*args, **kwargs)
        if self.__editing_instance:
            # Django < 1.5 returns list objects when ModelMultipleChoiceField
            # is empty.. so check before calling delete()
            if self.cleaned_data['delete_subscriptions']:
                self.cleaned_data['delete_subscriptions'].delete()
            self.cleaned_data['delete_subscriptions'].delete()
            if self.cleaned_data['email'] == 1:
                instance.subscription_set.all().update(
                    send_emails=False,