Example #1
0
def motd(request):
    form = None
    motd_editable = acl.action_allowed(
        request, amo.permissions.ADDON_REVIEWER_MOTD_EDIT)
    if motd_editable:
        form = forms.MOTDForm(
            initial={'motd': get_config('reviewers_review_motd')})
    data = context(request, form=form, motd_editable=motd_editable)
    return render(request, 'reviewers/motd.html', data)
Example #2
0
def save_motd(request):
    if not acl.action_allowed(request,
                              amo.permissions.ADDON_REVIEWER_MOTD_EDIT):
        raise PermissionDenied
    form = forms.MOTDForm(request.POST)
    if form.is_valid():
        set_config('reviewers_review_motd', form.cleaned_data['motd'])
        return redirect(reverse('reviewers.motd'))
    data = context(request, form=form)
    return render(request, 'reviewers/motd.html', data)