def POST(self, id): if session.get('logged_in', False): id = int(id) model.del_post(id) raise web.seeother('/') else: raise web.seeother('/login')
def POST(self, id): form = web.input() password = form.password if str(password) == '123': model.del_post(int(id)) raise web.seeother('/') else: return render.base('You\'re Evil')
def POST(self, id): if not session.admin: authorization_error() post = model.get_post(int(id)) if not model.authorized_user(session.userId, post.contactId): authorization_error() model.del_post(int(id)) raise web.seeother('/')
def POST(self, id): # 1. 删除静态资源照片 post = model.get_post(int(id)) photo_name = post.imageAddr.split('/')[-1] logger.debug('need delete photo path: ' + "/root/images/" + photo_name) try: os.remove("/root/images/" + photo_name) except Exception as e: logger.error(e) # 2. 删除表中记录 model.del_post(int(id)) #raise web.seeother("/") posts = model.get_posts() return render.index(posts)
def POST(self, id): model.del_post(int(id)) raise web.seeother('/')
def GET(self, id): model.del_post(int(id)) if web.cookies().get('username') == 'admin': raise web.seeother('/backstage') else: raise web.seeother('/')
def GET(self,id): model.del_post(id) raise web.seeother('/')
def POST(self, id): thisPost = model.get_post(int(id)) thisUser = auth.getUser() if thisPost.user_id == thisUser.user_id: model.del_post(int(id)) raise web.seeother("/")
def POST(self, id): id_producto = int(id) model.del_post(id_producto) raise web.seeother('/')
def POST(self, post_id): model.del_post(post_id) raise web.seeother('/')