def index(): # Try login, try cookies, else return template resp = login_or_register() or login_cookies() if resp: resp, user = resp # If there is a comment, create a new one comment_content = request.values.get("comment") if comment_content: Comment.new_comment(int(request.values.get("post-id")), user.name, comment_content) return resp return render_template("index.html", config=Config.config)