예제 #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)