fix small issue in sql.py which cause AttributeError by io614 · Pull Request #137 · cs50/python-cs50 · GitHub
Skip to content

fix small issue in sql.py which cause AttributeError#137

Closed
io614 wants to merge 1 commit into
cs50:developfrom
io614:golemarms-sql-fix
Closed

fix small issue in sql.py which cause AttributeError#137
io614 wants to merge 1 commit into
cs50:developfrom
io614:golemarms-sql-fix

Conversation

@io614

@io614 io614 commented Nov 29, 2020

Copy link
Copy Markdown

When debug mode is off, sometimes a

AttributeError: '_AppCtxGlobals' object has no attribute '_connection' 

is thrown during operation. This is solved by checking that _connection exists in the flask application context before looking up its value.

@dmalan dmalan self-requested a review November 29, 2020 11:41
@dmalan dmalan self-assigned this Nov 29, 2020
@dmalan dmalan added the bug label Nov 29, 2020
@dmalan

dmalan commented Nov 29, 2020

Copy link
Copy Markdown
Member

@dmalan dmalan closed this Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants