diff --git a/files/routes/comments.py b/files/routes/comments.py index 92456d98c..1025dc1d2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -271,7 +271,7 @@ def api_comment(v): parent_comment_id=parent_comment_id, top_comment_id=top_comment_id, level=level, - over_18=parent_post.over_18 or request.values.get("over_18","")=="true", + over_18=parent_post.over_18 or request.values.get("over_18")=="true", is_bot=is_bot, app_id=v.client.application.id if v.client else None, body_html=body_html, @@ -288,7 +288,8 @@ def api_comment(v): parent_comment_id=c.id, level=level+1, body_html=filter_emojis_only(option), - upvotes=0 + upvotes=0, + is_bot=True ) g.db.add(c_option) @@ -550,7 +551,7 @@ def edit_comment(cid, v): c = get_comment(cid, v=v) - if not c.author_id == v.id: abort(403) + if c.author_id != v.id: abort(403) body = request.values.get("body", "").strip()[:10000] @@ -577,7 +578,8 @@ def edit_comment(cid, v): parent_comment_id=c.id, level=c.level+1, body_html=filter_emojis_only(i.group(1)), - upvotes=0 + upvotes=0, + is_bot=True ) g.db.add(c_option) @@ -718,7 +720,7 @@ def delete_comment(cid, v): if not c: abort(404) - if not c.author_id == v.id: abort(403) + if c.author_id != v.id: abort(403) c.deleted_utc = int(time.time()) @@ -740,7 +742,7 @@ def undelete_comment(cid, v): if not c: abort(404) - if not c.author_id == v.id: + if c.author_id != v.id: abort(403) c.deleted_utc = 0 diff --git a/files/routes/login.py b/files/routes/login.py index 0aa7d5195..cd4a76a68 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -441,7 +441,7 @@ def post_reset(v): if not user: abort(404) - if not password == confirm_password: + if password != confirm_password: return render_template("reset_password.html", v=user, token=token, diff --git a/files/routes/posts.py b/files/routes/posts.py index 5f9a225e2..0278f92c6 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -45,7 +45,7 @@ def toggle_club(pid, v): @auth_required def publish(pid, v): post = get_post(pid) - if not post.author_id == v.id: abort(403) + if post.author_id != v.id: abort(403) post.private = False post.created_utc = int(time.time()) g.db.add(post) @@ -437,7 +437,8 @@ def edit_post(pid, v): parent_submission=p.id, level=1, body_html=filter_emojis_only(i.group(1)), - upvotes=0 + upvotes=0, + is_bot=True ) g.db.add(c) @@ -906,7 +907,8 @@ def submit_post(v): parent_submission=new_post.id, level=1, body_html=filter_emojis_only(option), - upvotes=0 + upvotes=0, + is_bot=True ) g.db.add(bet_option) @@ -916,7 +918,8 @@ def submit_post(v): parent_submission=new_post.id, level=1, body_html=filter_emojis_only(option), - upvotes=0 + upvotes=0, + is_bot=True ) g.db.add(c) @@ -1098,7 +1101,7 @@ def submit_post(v): def delete_post_pid(pid, v): post = get_post(pid) - if not post.author_id == v.id: + if post.author_id != v.id: abort(403) post.deleted_utc = int(time.time()) @@ -1118,7 +1121,7 @@ def delete_post_pid(pid, v): @auth_required def undelete_post_pid(pid, v): post = get_post(pid) - if not post.author_id == v.id: abort(403) + if post.author_id != v.id: abort(403) post.deleted_utc =0 g.db.add(post) @@ -1134,7 +1137,7 @@ def undelete_post_pid(pid, v): def toggle_comment_nsfw(cid, v): comment = g.db.query(Comment).filter_by(id=cid).one_or_none() - if not comment.author_id == v.id and not v.admin_level > 1: abort(403) + if comment.author_id != v.id and not v.admin_level > 1: abort(403) comment.over_18 = not comment.over_18 g.db.add(comment) @@ -1149,7 +1152,7 @@ def toggle_post_nsfw(pid, v): post = get_post(pid) - if not post.author_id == v.id and not v.admin_level > 1: + if post.author_id != v.id and not v.admin_level > 1: abort(403) post.over_18 = not post.over_18 diff --git a/files/templates/changelog.html b/files/templates/changelog.html index 66c1fb3ee..319953657 100644 --- a/files/templates/changelog.html +++ b/files/templates/changelog.html @@ -25,12 +25,12 @@ {{t | capitalize}} diff --git a/files/templates/comments.html b/files/templates/comments.html index f810de690..698eb8625 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -436,7 +436,7 @@ {% endif %} - {% if v and not v.id==c.author_id and c.author_name != '👻' %} + {% if v and v.id != c.author_id and c.author_name != '👻' %} diff --git a/files/templates/home.html b/files/templates/home.html index 5440dc6fd..3f3bfa25c 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -54,12 +54,12 @@ {{t | capitalize}} diff --git a/files/templates/search.html b/files/templates/search.html index 93a07a30d..6d406c58f 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -23,12 +23,12 @@ {{t | capitalize}} diff --git a/files/templates/sidebar_Drama.html b/files/templates/sidebar_Drama.html index bfa3fff58..68782885a 100644 --- a/files/templates/sidebar_Drama.html +++ b/files/templates/sidebar_Drama.html @@ -1,7 +1,7 @@ diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 32cfef2ee..d1981c74c 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -42,12 +42,12 @@ {{t | capitalize}}