From d08d96acbcabcde23307ed060f71f95ba9cb7b8d Mon Sep 17 00:00:00 2001 From: Vladimir Kroz Date: Tue, 5 Dec 2017 08:54:59 -0800 Subject: [PATCH] Fix code example for HTTP Methods `return` is required to make 'http methods' example work --- docs/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 7440ccd2..d3f3dea0 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -315,9 +315,9 @@ of the :meth:`~flask.Flask.route` decorator to handle different HTTP methods. @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'POST': - do_the_login() + return do_the_login() else: - show_the_login_form() + return show_the_login_form() If ``GET`` is present, Flask automatically adds support for the ``HEAD`` method and handles ``HEAD`` requests according to the the `HTTP RFC`_. Likewise,