From b65f81bbcc0bafdbcb691a44777c928fd8917846 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 19 Sep 2021 15:08:47 +0200 Subject: [PATCH] fdsfs --- files/classes/user.py | 3 +-- files/templates/comments.html | 6 +++--- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index eb721256b2..bd8f5bb0fd 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -275,9 +275,8 @@ class User(Base, Stndrd, Age_times): @property def banned_by(self): - if not self.is_suspended: return None - return g.db.query(User).options(lazyload('*')).filter_by(id=self.is_banned).first() + return g.db.query(User).filter_by(id=self.is_banned).first() def has_badge(self, badgedef_id): return self.badges.filter_by(badge_id=badgedef_id).first() diff --git a/files/templates/comments.html b/files/templates/comments.html index c2827f3322..02b9b7c549 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -123,7 +123,7 @@ {% endfor %} {% endif %} - {% if c.bannedfor %} + {% if c.bannedfor and c.author.banned_by %} {% endif %} @@ -333,7 +333,7 @@ {% if v and v.admin_level==6 and v.id != c.author_id %}
  • Unban user
  • -
  • Ban user
  • +
  • Ban user
  • {% endif %} {% if v and v.admin_level >=4 and c.oauth_app %} @@ -492,7 +492,7 @@ {% if v and (c.post and v.admin_level == 6) %} {% if c.author_id != v.id %} -
  • Ban user
  • +
  • Ban user
  • Unban user
  • {% endif %} {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 3d0babb829..bd08de46c9 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -179,7 +179,7 @@ {% endif %} {% if v and v.admin_level == 6 and v.id!=p.author_id %} - + {% endif %} @@ -471,7 +471,7 @@ {% endif %} {% if v.admin_level >=3 and v.id!=p.author_id %} -
  • Ban user
  • +
  • Ban user
  • Unban user
  • {% endif %} {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 542a45fc06..334ac76c03 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -208,7 +208,7 @@ {% endif %} {% if v.admin_level >=3 and v.id!=p.author_id %} -
  • Ban user
  • +
  • Ban user
  • Unban user
  • {% endif %} {% endif %} @@ -371,7 +371,7 @@ {% endif %} {% if v and v.admin_level == 6 and v.id!=p.author_id %} - + {% endif %}