Commit graph

5 commits

Author SHA1 Message Date
zach wick
e08f365543
Fixes a comparison within one of the tutorial's Jinja2 templates.
The Jinja2 template previously compared the user id of the currently logged in user
with the `author_id` of each blog post in order to determine if the logged in user
had edit permissions on that blog post. However, one of `g.user['id']` and
`post['author_id']` was a string and the other was an integer. This caused the
equality comparison to fail in every case.

Now, a Jinja filter is used to cast each of the operands to the same type prior to
the equality comparison being evaluated. This ensures that the "Edit" link/button
now shows up when appropriate.

Signed-off-by: zach wick <zach@zachwick.com>
2022-05-04 19:26:30 -04:00
David Lord
2ae740dd49
f-strings everywhere 2020-04-04 12:10:00 -07:00
Grey Li
ef434ea998
Replace old pocoo links everywhere
pocco.org -> palletsprojects.com
2019-11-19 09:32:35 -08:00
Jesse Seldess
90aef1b2cf
Fix typos found while completing the Flask tutorial 2019-01-06 08:01:45 -08:00
David Lord
c3dd7b8e4c
rewrite tutorial docs and example 2018-04-09 00:53:25 -07:00