def changelist_view(self, request, extra_context=None): if extra_context is None: extra_context = {} settings_form = SettingsForm(request.POST or None) if settings_form.is_valid(): settings_form.save() return self.changelist_redirect() extra_context["settings_form"] = settings_form extra_context["title"] = _("Change %s" % force_unicode(Setting._meta.verbose_name_plural)) return super(SettingsAdmin, self).changelist_view(request, extra_context)
def changelist_view(self, request, extra_context=None): if extra_context is None: extra_context = {} settings_form = SettingsForm(request.POST or None) if settings_form.is_valid(): settings_form.save() info(request, _("Settings were successfully updated.")) return self.changelist_redirect() extra_context["settings_form"] = settings_form extra_context["title"] = "%s %s" % (_("Change"), force_text(Setting._meta.verbose_name_plural)) return super(SettingsAdmin, self).changelist_view(request, extra_context)
def changelist_view(self, request, extra_context=None): if extra_context is None: extra_context = {} settings_form = SettingsForm(request.POST or None) if settings_form.is_valid(): settings_form.save() info(request, _("Settings were successfully updated.")) return self.changelist_redirect() extra_context["settings_form"] = settings_form extra_context["title"] = u"%s %s" % ( _("Change"), force_unicode(Setting._meta.verbose_name_plural)) return super(SettingsAdmin, self).changelist_view(request, extra_context)
def changelist_view(self, request, extra_context=None): if extra_context is None: extra_context = {} settings_form = SettingsForm(request.POST or None) if settings_form.is_valid(): settings_form.save() settings.clear_cache() info(request, _("Settings were successfully updated.")) return self.changelist_redirect() extra_context["settings_form"] = settings_form extra_context["title"] = "{} {}".format( _("Change"), force_str(Setting._meta.verbose_name_plural), ) return super().changelist_view(request, extra_context)
def changelist_view(self, request, extra_context=None): if extra_context is None: extra_context = {} settings_form = SettingsForm(request.POST or None) if settings_form.is_valid(): settings_form.save() info(request, _("Settings were successfully updated.")) if cache_installed(): cache_key = (cache_key_prefix(request, ignore_device=True) + "context-settings") cache_delete(cache_key) return self.changelist_redirect() extra_context["settings_form"] = settings_form extra_context["title"] = u"%s %s" % ( _("Change"), force_text(Setting._meta.verbose_name_plural)) return super(SettingsAdmin, self).changelist_view(request, extra_context)