def motd(request): form = None motd = get_config('mkt_reviewers_motd') if acl.action_allowed(request, 'AppReviewerMOTD', 'Edit'): form = MOTDForm(request.POST or None, initial={'motd': motd}) if form and request.method == 'POST' and form.is_valid(): set_config(u'mkt_reviewers_motd', form.cleaned_data['motd']) return redirect(reverse('reviewers.apps.motd')) data = context(form=form) return jingo.render(request, 'reviewers/motd.html', data)
def motd(request): form = None motd = unmemoized_get_config('mkt_reviewers_motd') if acl.action_allowed(request, 'AppReviewerMOTD', 'Edit'): form = MOTDForm(request.POST or None, initial={'motd': motd}) if form and request.method == 'POST' and form.is_valid(): set_config(u'mkt_reviewers_motd', form.cleaned_data['motd']) return redirect(reverse('reviewers.apps.motd')) data = context(request, form=form) return jingo.render(request, 'reviewers/motd.html', data)
def motd(request): form = None motd = get_config("mkt_reviewers_motd") if acl.action_allowed(request, "AppReviewerMOTD", "Edit"): form = MOTDForm(request.POST or None, initial={"motd": motd}) if form and request.method == "POST" and form.is_valid(): set_config(u"mkt_reviewers_motd", form.cleaned_data["motd"]) return redirect(reverse("reviewers.apps.motd")) data = context(form=form) return jingo.render(request, "reviewers/motd.html", data)
def motd(request): form = None motd = unmemoized_get_config('mkt_reviewers_motd') if acl.action_allowed(request, 'AppReviewerMOTD', 'Edit'): form = MOTDForm(request.POST or None, initial={'motd': motd}) if form and request.method == 'POST' and form.is_valid(): set_config(u'mkt_reviewers_motd', form.cleaned_data['motd']) messages.success(request, _('Changes successfully saved.')) return redirect(reverse('reviewers.apps.motd')) data = context(request, form=form) return render(request, 'reviewers/motd.html', data)