예제 #1
0
파일: tests_admin.py 프로젝트: gone/Spirit
    def test_basic_config(self):
        """
        basic conf edition
        """
        form_data = {"site_name": "foo",
                     "site_description": "",
                     "template_footer": ""}
        form = BasicConfigForm(data=form_data)
        self.assertEqual(form.is_valid(), True)

        form_data = {"site_name": "foo",
                     "site_description": "bar",
                     "template_footer": "foobar"}
        form = BasicConfigForm(data=form_data)
        self.assertEqual(form.is_valid(), True)
예제 #2
0
파일: config.py 프로젝트: 0sw4l/devhunter
def config_basic(request):

    if request.method == 'POST':
        form = BasicConfigForm(data=request.POST)

        if form.is_valid():
            form.save()
            messages.info(request, _("Settings updated!"))
            return redirect(request.GET.get("next", request.get_full_path()))
    else:
        form = BasicConfigForm()

    return render(request, 'spirit/admin/config/config_basic.html', {'form': form, })
예제 #3
0
파일: config.py 프로젝트: yanabeda/Spirit
def config_basic(request):

    if request.method == 'POST':
        form = BasicConfigForm(data=request.POST)

        if form.is_valid():
            form.save()
            messages.info(request, _("Settings updated!"))
            return redirect(request.GET.get("next", request.get_full_path()))
    else:
        form = BasicConfigForm()

    return render(request, 'spirit/admin/config/config_basic.html', {'form': form, })