The url_for generator in flask is not working for one of my views (it works for other views). The generator is giving /user/?name=Joe while I expect /u/Joe.
In the template I am trying to get the URL for the user page using: {{ url_for('user', name = g.user.name ) }}
This is the corresponding view function:
@app.route('/u/<name>')
@login_required
def user(name):
At first this was working but something changed. I have tried changing the view name and url with no luck.
Any thoughts? I am at a loss on this one...
The full app is available on GitHub: https://github.com/joehand/weight-and-more-tracker
Edit: The @login_required decorated is the one provided by Flask-login.
Additionally, removing the <name> variable does not solve the issue. The URL is then just /user.