fix shadowbanned and nonexistent users in marseys table

pull/23/head
justcool393 2022-11-27 11:13:23 -06:00
parent 767cc467bb
commit 5a1224ddc7
4 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -35,7 +35,7 @@
{% for user in alts %}
<tr>
<td>{{loop.index}}</td>
<td>{% include "admin/shadowbanned_tooltip.html" %}{% include "user_in_table.html" %}</td>
<td>{% include "user_in_table.html" %}</td>
<td>{{user.created_utc|timestamp}}</td>
<td>{{user._alt_created_utc|timestamp}}</td>
<td>{{user._is_manual}}</td>

View File

@ -27,7 +27,7 @@
<td>{{marsey.count}}</td>
{% if FEATURES['ASSET_SUBMISSIONS'] %}
{% set user = marsey.user %}
<td data-sort-key="{{user.username}}">{% include "user_in_table.html" %}</td>
<td data-sort-key="{{user.username.lower() if user else ''}}">{% include "user_in_table.html" %}</td>
{% endif %}
<td data-sort-key="{{marsey.created_utc or 0}}" {% if marsey.created_utc != None %}data-time="{{marsey.created_utc}}"{% endif %}></td>
{% if FEATURES['ASSET_SUBMISSIONS'] %}

View File

@ -1,3 +1,5 @@
{%- include 'admin/shadowbanned_tooltip.html' -%}
{% if user and (not user.shadowbanned or v.can_see_shadowbanned) %}
<a style="color:#{{user.name_color}};font-weight:bold" href="/@{{user.username}}">
<div class="profile-pic-20-wrapper mb-2">
<img loading="lazy" src="{{user.profile_url}}" class="pp20">
@ -7,3 +9,4 @@
</div>
<span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.user_name}}</span>
</a>
{% endif %}