From 5a1224ddc7f6f46f45d53dd6218e042bba5a1f24 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 27 Nov 2022 11:13:23 -0600 Subject: [PATCH] fix shadowbanned and nonexistent users in marseys table --- files/routes/static.py | 2 +- files/templates/admin/alts.html | 2 +- files/templates/marseys.html | 2 +- files/templates/user_in_table.html | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index dde4590f6..bd0478314 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -27,7 +27,7 @@ def rdrama(id, title): @auth_required def marseys(v:User): marseys = get_marseys(g.db) - authors = get_accounts_dict([m.author_id for m in marseys], graceful=True, include_shadowbanned=False) + authors = get_accounts_dict([m.author_id for m in marseys], v=v, graceful=True, include_shadowbanned=False) original = os.listdir("/asset_submissions/marseys/original") for marsey in marseys: marsey.user = authors.get(marsey.author_id) diff --git a/files/templates/admin/alts.html b/files/templates/admin/alts.html index 2ef58ed52..b01f443e3 100644 --- a/files/templates/admin/alts.html +++ b/files/templates/admin/alts.html @@ -35,7 +35,7 @@ {% for user in alts %} {{loop.index}} - {% include "admin/shadowbanned_tooltip.html" %}{% include "user_in_table.html" %} + {% include "user_in_table.html" %} {{user.created_utc|timestamp}} {{user._alt_created_utc|timestamp}} {{user._is_manual}} diff --git a/files/templates/marseys.html b/files/templates/marseys.html index e650daa6b..1a5f1bee3 100644 --- a/files/templates/marseys.html +++ b/files/templates/marseys.html @@ -27,7 +27,7 @@ {{marsey.count}} {% if FEATURES['ASSET_SUBMISSIONS'] %} {% set user = marsey.user %} - {% include "user_in_table.html" %} + {% include "user_in_table.html" %} {% endif %} {% if FEATURES['ASSET_SUBMISSIONS'] %} diff --git a/files/templates/user_in_table.html b/files/templates/user_in_table.html index 70632d837..a48fa2295 100644 --- a/files/templates/user_in_table.html +++ b/files/templates/user_in_table.html @@ -1,3 +1,5 @@ +{%- include 'admin/shadowbanned_tooltip.html' -%} +{% if user and (not user.shadowbanned or v.can_see_shadowbanned) %}
@@ -7,3 +9,4 @@
{{user.user_name}}
+{% endif %}