From 8dd1cd9045bad112d93e58b96332c5dd1b4df996 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 15 Jul 2020 16:01:33 +0100 Subject: Increase comment length limit to 2000 --- app/blueprints/threads/__init__.py | 7 ++----- app/models.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/blueprints/threads/__init__.py b/app/blueprints/threads/__init__.py index fbaab87..705703a 100644 --- a/app/blueprints/threads/__init__.py +++ b/app/blueprints/threads/__init__.py @@ -141,14 +141,11 @@ def delete_reply(id): return redirect(thread.getViewURL()) - - class CommentForm(FlaskForm): - comment = TextAreaField("Comment", [InputRequired(), Length(10, 500)]) + comment = TextAreaField("Comment", [InputRequired(), Length(10, 2000)]) submit = SubmitField("Comment") - @bp.route("/threads//edit/", methods=["GET", "POST"]) @login_required def edit_reply(id): @@ -226,7 +223,7 @@ def view(id): class ThreadForm(FlaskForm): title = StringField("Title", [InputRequired(), Length(3,100)]) - comment = TextAreaField("Comment", [InputRequired(), Length(10, 500)]) + comment = TextAreaField("Comment", [InputRequired(), Length(10, 2000)]) private = BooleanField("Private") submit = SubmitField("Open Thread") diff --git a/app/models.py b/app/models.py index af4b3b2..2bb6d3d 100644 --- a/app/models.py +++ b/app/models.py @@ -1146,7 +1146,7 @@ class Thread(db.Model): class ThreadReply(db.Model): id = db.Column(db.Integer, primary_key=True) thread_id = db.Column(db.Integer, db.ForeignKey("thread.id"), nullable=False) - comment = db.Column(db.String(500), nullable=False) + comment = db.Column(db.String(2000), nullable=False) author_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False) created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow) -- cgit v1.2.3