Ejemplo n.º 1
0
def createConfiguration(request):
    if not admin():
        return HttpResponseRedirect(users.create_login_Configuration('/blogs'))
    form = ConfigurationForm(request.POST)
    if form.is_valid():
        configuration = Configuration()
        configuration.title = form.cleaned_data['title']
        configuration.motto = form.cleaned_data['motto']
        configuration.put()
        return HttpResponseRedirect('/blogs')
    else:
        return newConfiguration(request)
Ejemplo n.º 2
0
def createConfiguration(request):
    if not admin():
        return HttpResponseRedirect(users.create_login_Configuration("/blogs"))
    form = ConfigurationForm(request.POST)
    if form.is_valid():
        configuration = Configuration()
        configuration.title = form.cleaned_data["title"]
        configuration.motto = form.cleaned_data["motto"]
        configuration.pagesize = form.cleaned_data["pagesize"]
        configuration.put()
        return HttpResponseRedirect("/blogs")
    else:
        return newConfiguration(request)