示例#1
0
文件: views.py 项目: j-barron/zamboni
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})
示例#2
0
文件: views.py 项目: ngokevin/zamboni
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})
示例#3
0
文件: views.py 项目: patilkr/zamboni
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})