mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-06 03:16:21 -06:00
Fix new post form length filters not redirecting correctly
I never ran into this error myself, but I think if we did, it's possible it could have caused some kind of infinite loop. Or it would just error because the form is mapped to POST requests only - unless the browser would take the redirect and send the POST request there - but that wouldn't make sense given it's normal purpose.
This commit is contained in:
4
forms.py
4
forms.py
@@ -31,10 +31,10 @@ def new_post():
|
||||
|
||||
if len(post_text) < 15:
|
||||
flash('Must have at least 15 characters of text.')
|
||||
return redirect(url_for('forms.new_post'))
|
||||
return redirect(url_for('main.feed'))
|
||||
elif len(post_text) > 1000:
|
||||
flash('Cannot have more than 1000 characters of text.')
|
||||
return redirect(url_for('forms.new_post'))
|
||||
return redirect(url_for('main.feed'))
|
||||
|
||||
post = Post(author=current_user.id, text=post_text)
|
||||
db.session.add(post)
|
||||
|
||||
Reference in New Issue
Block a user