Skip to content

Commit 19a72d9

Browse files
Fix Exception that will occur later in course.
Exception will occur at time 4:15 in the video "User input and HTML forms: Getting the submitted values" of course "Building data-driven web apps with Flask and SQLAlchemy". This exception happens because the flask.redirect() returns a werkzeug.wrappers.response.Response. The inserted condition will check for this response and return the redirect correctly. This fix likely needs to be added to other versions in the course files. For more info, see email to Michael titled "please help: Exception in course 'building data-driven web apps...'" dated Sep 24, 2019, 1:48 PM.
1 parent 0e593fe commit 19a72d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/ch05_jinja_templates/final/pypi_org/infrastructure/view_modifiers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ def response_inner(f):
1010
@wraps(f)
1111
def view_method(*args, **kwargs):
1212
response_val = f(*args, **kwargs)
13+
14+
if isinstance(response_val, werkzeug.wrappers.response.Response):
15+
return response_val
16+
1317
if isinstance(response_val, flask.Response):
1418
return response_val
1519

0 commit comments

Comments
 (0)