Reputation: 497
Ideally I would like to return this, but it doesn't work:
return redirect(url_for('register'), message='email already exists')
I've tried this version without the url_for:
return redirect('register.html', message='email already exists')
does not work either. Do you have to return the message explicitly in the url or save it in a cookie? Is there not a cleaner way to do it?
Thank you for help
Upvotes: 0
Views: 5800
Reputation: 1464
According to the official docs, the parameters should be pass in the url_for, not the redirect.
return redirect(url_for('register', message='email already exists'))
Upvotes: 3