Fix comment length checking

This commit is contained in:
rubenwardy 2020-07-29 17:33:12 +01:00
parent a8a3067ac9
commit e931d6a88b
3 changed files with 4 additions and 4 deletions

@ -199,7 +199,7 @@ def view(id):
flash("Please wait before commenting again", "danger")
return redirect(thread.getViewURL())
if len(comment) <= 500 and len(comment) > 3:
if len(comment) <= 2000 and len(comment) > 3:
reply = ThreadReply()
reply.author = current_user
reply.comment = comment
@ -216,7 +216,7 @@ def view(id):
return redirect(thread.getViewURL())
else:
flash("Comment needs to be between 3 and 500 characters.")
flash("Comment needs to be between 3 and 2000 characters.")
return render_template("threads/view.html", thread=thread)

@ -104,7 +104,7 @@
<input class="form-control" id="title" name="title" required="" type="text">
</div>
<textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br />
<textarea class="form-control markdown" required maxlength=2000 name="comment"></textarea><br />
<input class="btn btn-primary" type="submit" value="{{ _('Post Review') }}" />
</form>
</div>

@ -85,7 +85,7 @@
{% else %}
<form method="post" action="{{ url_for('threads.view', id=thread.id)}}" class="card-body">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br />
<textarea class="form-control markdown" required maxlength=2000 name="comment"></textarea><br />
<input class="btn btn-primary" type="submit" value="Comment" />
</form>
{% endif %}