コード例 #1
0
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)
コード例 #2
0
ファイル: views.py プロジェクト: wraithan/zamboni
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)
コード例 #3
0
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)
コード例 #4
0
ファイル: views.py プロジェクト: Dreadchild/zamboni
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)