From f7d515de86ad1ceab1b330cf1d95257b712b2659 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 27 Apr 2016 21:01:28 -0500 Subject: fix bugs in design defense code examples fixes #2287 --- docs/designdefense.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 3c1046b82..70dbbe720 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1297,12 +1297,12 @@ Consider the following simple `Groundhog from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/admin') + @app.route('/admin') def admin(): return 'admin page' - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return 'add' if action == 'delete': @@ -1322,15 +1322,15 @@ order of the function definitions in the file? from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return 'add' if action == 'delete': return 'delete' return app.abort(404) - app.route('/admin') + @app.route('/admin') def admin(): return 'admin page' -- cgit v1.2.3