diff --git a/files/classes/comment.py b/files/classes/comment.py
index b115028268..975264e7dc 100644
--- a/files/classes/comment.py
+++ b/files/classes/comment.py
@@ -13,8 +13,8 @@ from .flags import CommentFlag
from random import randint
site = environ.get("DOMAIN").strip()
-if site == 'pcmemes.net': cc = "splash mountain"
-else: cc = "country club"
+if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
+else: cc = "COUNTRY CLUB"
class Comment(Base):
@@ -305,7 +305,7 @@ class Comment(Base):
return data
def realbody(self, v):
- if self.post and self.post.club and not (v and v.paid_dues): return f"
{cc} ONLY
"
+ if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"
{cc} ONLY
"
body = self.body_html
@@ -342,7 +342,7 @@ class Comment(Base):
return body
def plainbody(self, v):
- if self.post and self.post.club and not (v and v.paid_dues): return f"
{cc} ONLY
"
+ if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"
{cc} ONLY
"
body = self.body
diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py
index e2310965e5..e2ec233f6d 100644
--- a/files/classes/mod_logs.py
+++ b/files/classes/mod_logs.py
@@ -6,8 +6,8 @@ from files.helpers.lazy import lazy
from os import environ
site = environ.get("DOMAIN").strip()
-if site == 'pcmemes.net': cc = "splash mountain"
-else: cc = "country club"
+if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
+else: cc = "COUNTRY CLUB"
class ModAction(Base):
__tablename__ = "modactions"
@@ -82,7 +82,7 @@ class ModAction(Base):
@lazy
def string(self):
- output = ACTIONTYPES[self.kind]["str"].format(self=self, cc=cc)
+ output = ACTIONTYPES[self.kind]["str"].format(self=self)
if self.note: output += f" ({self.note})"
@@ -93,7 +93,7 @@ class ModAction(Base):
def target_link(self):
if self.target_user: return f'{self.target_user.username}'
elif self.target_post:
- if self.target_post.club: return f'{cc.upper()} ONLY'
+ if self.target_post.club: return f'{cc} ONLY'
return f'{self.target_post.title.replace("<","").replace(">","")}'
elif self.target_comment_id: return f'comment'
diff --git a/files/routes/admin.py b/files/routes/admin.py
index 08abf81eb3..edd32391e3 100644
--- a/files/routes/admin.py
+++ b/files/routes/admin.py
@@ -1016,8 +1016,7 @@ def api_ban_comment(c_id, v):
def api_unban_comment(c_id, v):
comment = g.db.query(Comment).filter_by(id=c_id).first()
- if not comment:
- abort(404)
+ if not comment: abort(404)
g.db.add(comment)
if comment.is_banned:
@@ -1037,26 +1036,20 @@ def api_unban_comment(c_id, v):
@app.post("/distinguish_comment/")
-@auth_required
+@admin_level_required(1)
def admin_distinguish_comment(c_id, v):
- if v.admin_level == 0: abort(403)
comment = get_comment(c_id, v=v)
- if comment.author_id != v.id:
- abort(403)
+ if comment.author_id != v.id: abort(403)
comment.distinguish_level = 0 if comment.distinguish_level else v.admin_level
g.db.add(comment)
- html=render_template(
- "comments.html",
- v=v,
- comments=[comment],
- )
+ html = render_template("comments.html", v=v, comments=[comment])
- html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
+ html = str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
g.db.commit()
diff --git a/files/routes/users.py b/files/routes/users.py
index 2f9aa8b5cf..7bd6491772 100644
--- a/files/routes/users.py
+++ b/files/routes/users.py
@@ -646,17 +646,13 @@ def u_username_comments(username, v=None):
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
- if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 2):
+ if v and hasattr(u, 'is_blocking') and u.is_blocking:
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."}
- else: return render_template("userpage_blocking.html",
- u=u,
- v=v)
+ else: return render_template("userpage_blocking.html", u=u, v=v)
- if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 2):
+ if v and v.admin_level < 2 and hasattr(u, 'is_blocked') and u.is_blocked:
if request.headers.get("Authorization"): return {"error": "This person is blocking you."}
- else: return render_template("userpage_blocked.html",
- u=u,
- v=v)
+ else: return render_template("userpage_blocked.html", u=u, v=v)
page = int(request.values.get("page", "1"))
diff --git a/files/templates/admin/image_posts.html b/files/templates/admin/image_posts.html
index a8aa147562..c248b3667d 100644
--- a/files/templates/admin/image_posts.html
+++ b/files/templates/admin/image_posts.html
@@ -12,28 +12,27 @@
{% block fixedMobileBarJS %}
{% endblock %}
diff --git a/files/templates/admin/reported_posts.html b/files/templates/admin/reported_posts.html
index a748c65bcc..08c3a0c531 100644
--- a/files/templates/admin/reported_posts.html
+++ b/files/templates/admin/reported_posts.html
@@ -40,28 +40,27 @@
{% block fixedMobileBarJS %}
{% endblock %}
diff --git a/files/templates/authforms.html b/files/templates/authforms.html
index cc66fec5e0..019abbb7eb 100644
--- a/files/templates/authforms.html
+++ b/files/templates/authforms.html
@@ -15,11 +15,11 @@
{% if v %}
-
+
{% if v.agendaposter %}{% elif v.css %}{% endif %}
{% else %}
-
+
{% endif %}
diff --git a/files/templates/ban_modal.html b/files/templates/ban_modal.html
index 9b0739a227..6c0e2e8d9e 100644
--- a/files/templates/ban_modal.html
+++ b/files/templates/ban_modal.html
@@ -1,30 +1,27 @@
diff --git a/files/templates/embeds/twitter.html b/files/templates/embeds/twitter.html
index cd8eecdced..b557a764c3 100644
--- a/files/templates/embeds/twitter.html
+++ b/files/templates/embeds/twitter.html
@@ -2,8 +2,7 @@
\ No newline at end of file
diff --git a/files/templates/embeds/twitterlight.html b/files/templates/embeds/twitterlight.html
index 9214bf2623..13233b4d5f 100644
--- a/files/templates/embeds/twitterlight.html
+++ b/files/templates/embeds/twitterlight.html
@@ -2,8 +2,7 @@
\ No newline at end of file
diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html
index e1276d40cb..9dc726543b 100644
--- a/files/templates/emoji_modal.html
+++ b/files/templates/emoji_modal.html
@@ -84,7 +84,7 @@