X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=app%2Fblueprints%2Fthreads%2F__init__.py;h=5380389da67a43e6e326d40c3cd7ccac58b21b5c;hb=92fb54556ad0409a519c308e7e34b63e11621903;hp=21666af3834573d2d19aaa6cda9c79065fd95735;hpb=dfbcbbbb476cbbd467cabb1e36ea56ee84c99b43;p=cheatdb.git diff --git a/app/blueprints/threads/__init__.py b/app/blueprints/threads/__init__.py index 21666af..5380389 100644 --- a/app/blueprints/threads/__init__.py +++ b/app/blueprints/threads/__init__.py @@ -1,4 +1,4 @@ -# Content DB +# ContentDB # Copyright (C) 2018 rubenwardy # # This program is free software: you can redistribute it and/or modify @@ -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): @@ -202,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 @@ -219,14 +216,14 @@ 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) 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") @@ -301,6 +298,10 @@ def new(): if is_review_thread: package.review_thread = thread + if package.state == PackageState.READY_FOR_REVIEW and current_user not in package.maintainers: + package.state = PackageState.CHANGES_NEEDED + + notif_msg = "New thread '{}'".format(thread.title) if package is not None: addNotification(package.maintainers, current_user, notif_msg, thread.getViewURL(), package)