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

Solves the url redirect rule problem #51

Merged
merged 1 commit into from May 21, 2017
Merged

Conversation

@davidawad
Copy link
Contributor

@davidawad davidawad commented Jan 5, 2015

I brought this up a WHILE ago in an issue - #44
Finally remembered to fix it.

I brought this up a WHILE ago in an issue - #44
Finally remembered to fix it.
@davidawad
Copy link
Contributor Author

@davidawad davidawad commented Jan 5, 2015

phew! It passed!

@@ -9,6 +9,10 @@
WIKIPART = re.compile(r'([A-Z][a-z0-9_]+)')
WIKIWORD = re.compile(r'([A-Z][a-z0-9_]+(?:[A-Z][a-z0-9_]+)+)')

@app.route('/', methods=['GET'])
def redirect():

This comment has been minimized.

@dcrosta

dcrosta Jan 5, 2015
Owner

this will shadow "redirect" imported from flask module... should probably rename to homepage_redirect or something like that (that's what it was called before).

@@ -9,6 +9,10 @@
WIKIPART = re.compile(r'([A-Z][a-z0-9_]+)')
WIKIWORD = re.compile(r'([A-Z][a-z0-9_]+(?:[A-Z][a-z0-9_]+)+)')

@app.route('/', methods=['GET'])
def redirect():
return redirect(url_for('HomePage'))

This comment has been minimized.

@dcrosta

dcrosta Jan 5, 2015
Owner

I don't think url_for works this way. I think you have to give it the name of an endpoint (show_page in this case) with whatever arguments that endpoint accepts. You probably want something like url_for("show_page", page="HomePage" -- but please test to be sure I'm not making this up.

This comment has been minimized.

@davidawad

davidawad Jan 5, 2015
Author Contributor

I'll mess with it a little more extensively later tonight but that should be it.

@dcrosta dcrosta merged commit cb7695a into dcrosta:master May 21, 2017
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.