Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing self arguments in Flask __init__ replacement #82

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

chrisgzf
Copy link
Contributor

@chrisgzf chrisgzf commented Jul 10, 2019

Commit 3245685 broke the CS50 Flask monkey-patch, due to a missing self argument when swapping the __init__ functions of flask.Flask with both _before and _after. As such, they get NameError: name 'self' is not defined when running the app.

See https://www.reddit.com/r/cs50/comments/cbez89/finance_nameerror_name_self_is_not_defined/ to find users using the CS50 IDE facing issues with Flask.

This commit adds both self arguments into both _before and _after, fixing the issue.

This fix has been tested to work with pset7 similarities, and should fix the other psets that require the use of Flask as well.

Copy link
Member

@dmalan dmalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dmalan dmalan merged commit b851652 into cs50:develop Jul 10, 2019
@CristiFati
Copy link

Damn it! I was too rushed and missed the (obvious) 2nd spot. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants