def join_block(): if 'uid' not in session: logging.info(session) return redirect(url_for('login')) if request.method == 'POST': logging.info("/join_block") result = Users.requestBlock(db, request.form) if not result: message = {'message': 'Registration successful', 'type': 'success'} response = make_response( render_template("login.html", message=message)) response.headers['X-XSS-Protection'] = '1; mode=block' return response else: message = { 'message': 'Something went wrong: ' + result, 'type': 'error' } response = make_response( render_template("join_block.html", message=message)) response.headers['X-XSS-Protection'] = '1; mode=block' return response if request.method == 'GET': logging.info('populate available blocks') #blocks = return render_template('join_block.html')
def gethoodlist(): logging.info("in get hoodlist") hoodlist = Hood.gethoodlist(db) if request.method == 'POST': logging.info("/gethoodlist") result = Users.requestBlock(db.conn, request.form) if not result: message = {'message': 'Registration successful', 'type': 'success'} response = make_response(redirect("/login")) response.headers['X-XSS-Protection'] = '1; mode=block' return response else: message = { 'message': 'Something went wrong: ' + result, 'type': 'error' } response = make_response( render_template("join_block.html", message=message)) response.headers['X-XSS-Protection'] = '1; mode=block' return response return render_template('join_block.html', hoodinfo=hoodlist)