def motd(request): message = unmemoized_get_config('mkt_developers_motd') form = MOTDForm(request.POST or None, initial={'motd': message}) if request.method == 'POST' and form and form.is_valid(): set_config('mkt_developers_motd', form.cleaned_data['motd']) messages.success(request, _('Changes successfully saved.')) return redirect(reverse('mkt.developers.motd')) return render(request, 'developers/motd.html', {'form': form})
def motd(request): message = unmemoized_get_config("mkt_developers_motd") form = MOTDForm(request.POST or None, initial={"motd": message}) if request.method == "POST" and form and form.is_valid(): set_config("mkt_developers_motd", form.cleaned_data["motd"]) messages.success(request, _("Changes successfully saved.")) return redirect(reverse("mkt.developers.motd")) return render(request, "developers/motd.html", {"form": form})