Exemple #1
0
 def POST(self):
     title, body, published = web.input().title, web.input().body, int(web.input().published)
     if user.logged(session):
         if session.privilege == 2:
             if title == "" or body == "":
                 render = user.create_render(session)
                 return render.new(gen_head(), gen_offleft())
             blog.new_post(title, body, published)
     if published == 1:
         raise web.seeother('/blog')
     else:
         raise web.seeother('/americano')
Exemple #2
0
 def POST(self):
     title, body, published = web.input().title, web.input().body, int(
         web.input().published)
     if user.logged(session):
         if session.privilege == 2:
             if title == "" or body == "":
                 render = user.create_render(session)
                 return render.new(gen_head(), gen_offleft())
             blog.new_post(title, body, published)
     if published == 1:
         raise web.seeother('/blog')
     else:
         raise web.seeother('/americano')
Exemple #3
0
 def GET(self, id):
     check_installed()
     post = blog.get_post(int(id))
     if post is None:
         post_id = blog.new_post("", 0)
         raise web.seeother("/blog/edit/"+str(post_id))
     render = user.create_render(session)
     return render.edit(gen_head(), gen_offleft(), post, post.markdown)
Exemple #4
0
 def GET(self, id):
     check_installed()
     post = blog.get_post(int(id))
     if post is None:
         post_id = blog.new_post("", 0)
         raise web.seeother("/blog/edit/" + str(post_id))
     render = user.create_render(session)
     return render.edit(gen_head(), gen_offleft(), post, post.markdown)