diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6747a83c0..c67eaf794 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,2 @@ github: Aevann1 -patreon: Aevann custom: ["https://rdrama.gumroad.com/l/tfcvri"] diff --git a/drama/routes/comments.py b/drama/routes/comments.py index cea52edbc..901bcacc4 100644 --- a/drama/routes/comments.py +++ b/drama/routes/comments.py @@ -384,20 +384,19 @@ def api_comment(v): ) g.db.add(c) g.db.flush() - if v.dramacoins >= 0: - if request.files.get("file"): - file=request.files["file"] - if not file.content_type.startswith('image/'): - return jsonify({"error": "That wasn't an image!"}), 400 - - name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}' - url = upload_file(name, file) - - body = request.form.get("body") + f"\n" - body = body.replace("\n", "\n\n") - with CustomRenderer(post_id=parent_id) as renderer: - body_md = renderer.render(mistletoe.Document(body)) - body_html = sanitize(body_md, linkgen=True) + if request.files.get("file"): + file=request.files["file"] + if not file.content_type.startswith('image/'): + return jsonify({"error": "That wasn't an image!"}), 400 + + name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}' + url = upload_file(name, file) + + body = request.form.get("body") + f"\n" + body = body.replace("\n", "\n\n") + with CustomRenderer(post_id=parent_id) as renderer: + body_md = renderer.render(mistletoe.Document(body)) + body_html = sanitize(body_md, linkgen=True) c_aux = CommentAux( id=c.id, @@ -738,35 +737,34 @@ def edit_comment(cid, v): g.db.commit() return jsonify({"error": "Too much spam!"}), 403 - if v.dramacoins >= 0: - if request.files.get("file"): - file=request.files["file"] - if not file.content_type.startswith('image/'): - return jsonify({"error": "That wasn't an image!"}), 400 - - name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}' - url = upload_file(name, file) + if request.files.get("file"): + file=request.files["file"] + if not file.content_type.startswith('image/'): + return jsonify({"error": "That wasn't an image!"}), 400 + + name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}' + url = upload_file(name, file) - body += f"\n" - body = body.replace("\n", "\n\n") - with CustomRenderer(post_id=c.parent_submission) as renderer: - body_md = renderer.render(mistletoe.Document(body)) - body_html = sanitize(body_md, linkgen=True) + body += f"\n" + body = body.replace("\n", "\n\n") + with CustomRenderer(post_id=c.parent_submission) as renderer: + body_md = renderer.render(mistletoe.Document(body)) + body_html = sanitize(body_md, linkgen=True) + + # #csam detection + # def del_function(): + # delete_file(name) + # c.is_banned=True + # g.db.add(c) + # g.db.commit() - # #csam detection - # def del_function(): - # delete_file(name) - # c.is_banned=True - # g.db.add(c) - # g.db.commit() - - # csam_thread=threading.Thread(target=check_csam_url, - # args=(f"https://s3.eu-central-1.amazonaws.com/i.ruqqus.ga/{name}", - # v, - # del_function - # ) - # ) - # csam_thread.start() + # csam_thread=threading.Thread(target=check_csam_url, + # args=(f"https://s3.eu-central-1.amazonaws.com/i.ruqqus.ga/{name}", + # v, + # del_function + # ) + # ) + # csam_thread.start() c.body = body c.body_html = body_html diff --git a/drama/routes/posts.py b/drama/routes/posts.py index fa065fdcc..2e6ca1047 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -867,10 +867,6 @@ def submit_post(v): # check for embeddable video domain = parsed_url.netloc - if request.files.get('file') and not v.dramacoins >= 0: - abort(403) - - new_post = Submission( private=bool(request.form.get("private","")), author_id=v.id, diff --git a/drama/routes/settings.py b/drama/routes/settings.py index 8fc625587..f26475ddf 100644 --- a/drama/routes/settings.py +++ b/drama/routes/settings.py @@ -324,45 +324,37 @@ def settings_log_out_others(v): @auth_required @validate_formkey def settings_images_profile(v): - if v.dramacoins >= 0: - if request.content_length > 16 * 1024 * 1024: - g.db.rollback() - abort(413) + if request.content_length > 16 * 1024 * 1024: + g.db.rollback() + abort(413) - v.profileurl = None - imageurl = upload_file(name=f"profile.gif", file=request.files["profile"], resize=(100, 100)) - if imageurl: - v.profileurl = imageurl - g.db.add(v) + v.profileurl = None + imageurl = upload_file(name=f"profile.gif", file=request.files["profile"], resize=(100, 100)) + if imageurl: + v.profileurl = imageurl + g.db.add(v) - return render_template("settings_profile.html", - v=v, msg="Profile picture successfully updated.") - - return render_template("settings_profile.html", v=v, - msg="Avatars require +0 dramacoins.") + return render_template("settings_profile.html", + v=v, msg="Profile picture successfully updated.") @app.route("/settings/images/banner", methods=["POST"]) @auth_required @validate_formkey def settings_images_banner(v): - if v.dramacoins >= 0: - if request.content_length > 16 * 1024 * 1024: - g.db.rollback() - abort(413) + if request.content_length > 16 * 1024 * 1024: + g.db.rollback() + abort(413) - v.bannerurl = None - imageurl = upload_file(name=f"banner.gif", file=request.files["banner"]) - if imageurl: - v.bannerurl = imageurl - g.db.add(v) + v.bannerurl = None + imageurl = upload_file(name=f"banner.gif", file=request.files["banner"]) + if imageurl: + v.bannerurl = imageurl + g.db.add(v) - return render_template("settings_profile.html", - v=v, msg="Banner successfully updated.") - - return render_template("settings_profile.html", v=v, - msg="Banners require +0 dramacoins.") + return render_template("settings_profile.html", + v=v, msg="Banner successfully updated.") @app.route("/settings/delete/profile", methods=["POST"]) diff --git a/drama/templates/comments.html b/drama/templates/comments.html index 5b4b560bb..dcf840383 100644 --- a/drama/templates/comments.html +++ b/drama/templates/comments.html @@ -192,7 +192,7 @@ Reported by:
You have 0 ban awards (they're a patron perk):
https://rdrama.gumroad.com/l/tfcvri -This page is only available to patrons:
https://rdrama.gumroad.com/l/tfcvri -