diff --git a/files/classes/user.py b/files/classes/user.py
index c69e55899..5803d87af 100644
--- a/files/classes/user.py
+++ b/files/classes/user.py
@@ -211,12 +211,12 @@ class User(Base):
@cache.memoize(timeout=86400)
def userpagelisting(self, v=None, page=1, sort="new", t="all"):
- if self.shadowbanned and not (v and (v.admin_level >= 3 or v.id == self.id)):
+ if self.shadowbanned and not (v and (v.admin_level > 1 or v.id == self.id)):
return []
posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False)
- if not (v and (v.admin_level >= 3 or v.id == self.id)):
+ if not (v and (v.admin_level > 1 or v.id == self.id)):
posts = posts.filter_by(deleted_utc=0, is_banned=False, private=False)
now = int(time.time())
diff --git a/files/routes/comments.py b/files/routes/comments.py
index f01899c8e..fc171b14d 100644
--- a/files/routes/comments.py
+++ b/files/routes/comments.py
@@ -122,7 +122,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
if request.headers.get("Authorization"): return top_comment.json
else:
- if post.is_banned and not (v and (v.admin_level >= 3 or post.author_id == v.id)): template = "submission_banned.html"
+ if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
else: template = "submission.html"
return render_template(template, v=v, p=post, sort=sort, linked_comment=comment, comment_info=comment_info, render_replies=True)
@@ -203,7 +203,7 @@ def api_comment(v):
).first()
if existing: return {"error": f"You already made that comment: /comment/{existing.id}"}, 409
- if parent.author.any_block_exists(v) and not v.admin_level>=3: return {"error": "You can't reply to users who have blocked you, or users you have blocked."}, 403
+ if parent.author.any_block_exists(v) and v.admin_level < 2: return {"error": "You can't reply to users who have blocked you, or users you have blocked."}, 403
is_bot = request.headers.get("Authorization")
diff --git a/files/routes/front.py b/files/routes/front.py
index a4ccb8eae..3650d9de7 100644
--- a/files/routes/front.py
+++ b/files/routes/front.py
@@ -369,7 +369,7 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
Comment.author_id.notin_(blocked)
)
- if not v or not v.admin_level >= 3:
+ if not v or not v.admin_level > 1:
comments = comments.filter_by(is_banned=False).filter(Comment.deleted_utc == 0)
now = int(time.time())
diff --git a/files/routes/posts.py b/files/routes/posts.py
index bf9bfc29d..dcada4752 100644
--- a/files/routes/posts.py
+++ b/files/routes/posts.py
@@ -201,7 +201,7 @@ def post_id(pid, anything=None, v=None):
g.db.commit()
if request.headers.get("Authorization"): return post.json
else:
- if post.is_banned and not (v and (v.admin_level >= 3 or post.author_id == v.id)): template = "submission_banned.html"
+ if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
else: template = "submission.html"
return render_template(template, v=v, p=post, sort=sort, render_replies=True)
@@ -991,7 +991,7 @@ def undelete_post_pid(pid, v):
def toggle_comment_nsfw(cid, v):
comment = g.db.query(Comment).filter_by(id=cid).first()
- if not comment.author_id == v.id and not v.admin_level >= 3: abort(403)
+ if not comment.author_id == v.id and not v.admin_level > 1: abort(403)
comment.over_18 = not comment.over_18
g.db.add(comment)
g.db.flush()
@@ -1008,7 +1008,7 @@ def toggle_post_nsfw(pid, v):
post = get_post(pid)
- if not post.author_id == v.id and not v.admin_level >= 3:
+ if not post.author_id == v.id and not v.admin_level > 1:
abort(403)
post.over_18 = not post.over_18
diff --git a/files/routes/search.py b/files/routes/search.py
index 7fdcaa771..de4ffa182 100644
--- a/files/routes/search.py
+++ b/files/routes/search.py
@@ -90,13 +90,13 @@ def searchposts(v):
)
)
- if not(v and v.admin_level >= 3):
+ if not(v and v.admin_level > 1):
posts = posts.filter(
Submission.deleted_utc == 0,
Submission.is_banned == False,
)
- if v and v.admin_level >= 4:
+ if v and v.admin_level > 1:
pass
elif v:
blocking = [x[0] for x in g.db.query(
@@ -207,7 +207,7 @@ def searchcomments(v):
if 'author' in criteria: comments = comments.filter(Comment.author_id == get_user(criteria['author']).id)
- if not(v and v.admin_level >= 3):
+ if not(v and v.admin_level > 1):
comments = comments.filter(
Comment.deleted_utc == 0,
Comment.is_banned == False)
diff --git a/files/templates/comments.html b/files/templates/comments.html
index b9401a897..c3eabf544 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -291,7 +291,7 @@
{% endif %}
{% if c.active_flags %}{{c.active_flags}} Reports{% endif %}
{% if c.over_18 %}+18{% endif %}
- {% if v and v.admin_level> 1 and c.author.shadowbanned %}{% endif %}
+ {% if v and v.admin_level > 1 and c.author.shadowbanned %}{% endif %}
{% if c.is_pinned %}{% endif %}
{% if c.distinguish_level %}{% endif %}
{% if c.is_op %}{% endif %}
@@ -319,7 +319,7 @@
{% for f in c.ordered_flags %}
-
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level> 1 %}[remove]{% endif %}
+
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level > 1 %}[remove]{% endif %}
{% endfor %}
@@ -461,7 +461,7 @@
{% endif %}
{% endif %}
- {% if v and v.admin_level> 1 and v.id==c.author_id %}
+ {% if v and v.admin_level > 1 and v.id==c.author_id %}
UndistinguishDistinguish
{% endif %}
@@ -474,14 +474,14 @@
Block user
{% endif %}
- {% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) and c.level == 1 %}
+ {% if v and c.post and (v.admin_level > 1 or v.id == c.post.author_id) and c.level == 1 %}
UnpinPin
{% endif %}
- {% if v and v.admin_level>=3 %}
+ {% if v and v.admin_level > 1 %}
{% if "/reported/" in request.path %}
ApproveRemove
@@ -496,12 +496,12 @@
Mark +18
{% endif %}
- {% if v and v.admin_level> 1 and v.id != c.author_id %}
+ {% if v and v.admin_level > 1 and v.id != c.author_id %}
Unban userBan user
{% endif %}
- {% if v and v.admin_level >=4 and c.oauth_app %}
+ {% if v and v.admin_level > 1 and c.oauth_app %}
API App
{% endif %}
@@ -624,17 +624,17 @@
{% endif %}
{% endif %}
- {% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) and c.level == 1 %}
+ {% if v and c.post and (v.admin_level > 1 or v.id == c.post.author_id) and c.level == 1 %}
PinUnpin
{% endif %}
{% if v %}
- {% if v.admin_level>=1 and v.id==c.author_id %}
+ {% if v.admin_level > 1 and v.id==c.author_id %}
DistinguishUndistinguish
{% endif %}
- {% if v.admin_level>=3 %}
+ {% if v.admin_level > 1 %}
{% if "/reported/" in request.path %}
RemoveApprove
@@ -643,7 +643,7 @@
Approve
{% endif %}
{% endif %}
- {% if v.admin_level >=4 and c.oauth_app %}
+ {% if v.admin_level > 1 and c.oauth_app %}
API App
{% endif %}
diff --git a/files/templates/header.html b/files/templates/header.html
index 30f8db4f7..7f97b6103 100644
--- a/files/templates/header.html
+++ b/files/templates/header.html
@@ -63,7 +63,7 @@
- {% if v and v.admin_level> 1 %}
+ {% if v and v.admin_level > 1 %}
diff --git a/files/templates/notifications.html b/files/templates/notifications.html
index fb87f91b7..e8581a7ef 100644
--- a/files/templates/notifications.html
+++ b/files/templates/notifications.html
@@ -30,7 +30,7 @@
Messages
- {% if v.admin_level> 1 %}
+ {% if v.admin_level > 1 %}
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level> 1 %}[remove]{% endif %}
+
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level > 1 %}[remove]{% endif %}
{% endfor %}
@@ -555,7 +555,7 @@
- {% if v and (v.id==p.author_id or v.admin_level> 1 and v.admin_level > 2) and not v.is_suspended %}
+ {% if v and (v.id==p.author_id or v.admin_level > 1 and v.admin_level > 2) and not v.is_suspended %}
{% endif %}
-{% if v.admin_level >=3 and v.id==p.author_id %}
+{% if v.admin_level > 1 and v.id==p.author_id %}
{% endif %}
-{% if v.admin_level >=1 and v.admin_level > p.author.admin_level %}
+{% if v.admin_level > 1 and v.admin_level > p.author.admin_level %}
{% if p.is_banned %}
- {% if v and v.admin_level >=3 and p.body_html %}
+ {% if v and v.admin_level > 1 and p.body_html %}
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level> 1 %}[remove]{% endif %}
+
{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% if v.admin_level > 1 %}[remove]{% endif %}
{% endfor %}
@@ -204,7 +204,7 @@
{% endfor %}
{% endif %}
- {% if v and v.admin_level> 1 and p.author.shadowbanned %}{% endif %}
+ {% if v and v.admin_level > 1 and p.author.shadowbanned %}{% endif %}
{% if p.stickied %}{% endif %}
{% if p.distinguish_level %}{% endif %}
{% if p.is_pinned and request.path.startswith('/@') %}{% endif %}
@@ -271,7 +271,7 @@
{% endif %}
{% endif %}
- {% if v and v.admin_level>=3 %}
+ {% if v and v.admin_level > 1 %}
PinUnpin
{% if v==p.author %}
@@ -281,12 +281,12 @@
{% endif %}
{% if v %}
- {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
+ {% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
Mark clubUnmark club
{% endif %}
- {% if v.admin_level >=3 %}
+ {% if v.admin_level > 1 %}
{% if "/reported/" in request.path %}
{% if v.id != p.author.id %}Remove{% endif %}
Approve
@@ -297,7 +297,7 @@
{% endif %}
- {% if v.admin_level >= 4 and p.oauth_app %}
+ {% if v.admin_level > 1 and p.oauth_app %}
API App
{% endif %}
@@ -309,12 +309,12 @@
Block user
{% endif %}
- {% if v and (v.id==p.author_id or v.admin_level>=3) %}
+ {% if v and (v.id==p.author_id or v.admin_level > 1) %}
Mark +18Unmark +18
{% endif %}
- {% if v.admin_level >=3 and v.id!=p.author_id %}
+ {% if v.admin_level > 1 and v.id!=p.author_id %}
Ban userUnban user
{% endif %}
@@ -437,12 +437,12 @@
- {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
+ {% if v.admin_level > 1 or v.id == p.author.id and v.paid_dues %}
{% endif %}
- {% if v.admin_level >=3 %}
+ {% if v.admin_level > 1 %}
{% if v==p.author %}
@@ -459,7 +459,7 @@
{% endif %}
{% endif %}
- {% if v.admin_level >=4 and p.oauth_app %}
+ {% if v.admin_level > 1 and p.oauth_app %}
{% endif %}
@@ -473,7 +473,7 @@
{% endif %}
- {% if v and (v.id==p.author_id or v.admin_level>=3) %}
+ {% if v and (v.id==p.author_id or v.admin_level > 1) %}
{% endif %}
diff --git a/files/templates/userpage.html b/files/templates/userpage.html
index ce4b4fd65..fe73c0d96 100644
--- a/files/templates/userpage.html
+++ b/files/templates/userpage.html
@@ -359,7 +359,7 @@
{% endif %}
User ID: {{u.id}}
- {% if v and v.admin_level >=4 %}
+ {% if v and v.admin_level > 1 %}
{% if u.is_private %}