def save_motd(request): form = 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)
def motd(request): form = None form = MOTDForm(initial={'motd': get_config('reviewers_review_motd')}) data = context(request, form=form) return render(request, 'reviewers/motd.html', data)