delete property that jc forgot to actually define...

pull/83/head
Aevann 2022-12-22 22:46:05 +02:00
parent 92cbe64ac0
commit 284b3ba9ec
5 changed files with 6 additions and 8 deletions

View File

@ -711,7 +711,7 @@ class User(Base):
@property
@lazy
def alt_ids(self):
return [x.id for x in self.get_alt_graph(g.db) if not x._alt_deleted]
return [x.id for x in self.get_alt_graph(g.db)]
@property
@lazy

View File

@ -102,7 +102,6 @@ def check_for_alts(current:User, include_current_session=True):
session["history"] = list(past_accs)
g.db.flush()
for u in get_alt_graph(current.id):
if u._alt_deleted: continue
if u.shadowbanned and current.id not in DONT_SHADOWBAN:
current.shadowbanned = u.shadowbanned
current.ban_reason = u.ban_reason

View File

@ -89,7 +89,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
if v.id == target.author.id:
coin_delta = 0
v_alts_id = [x.id for x in v.get_alt_graph(self.id) if not x._alt_deleted]
v_alts_id = [x.id for x in v.get_alt_graph(self.id)]
alt = False
if target.author.id in v.alt_ids or v.id in target.author.alt_ids:

View File

@ -39,10 +39,9 @@
<td>{{user.created_utc|timestamp}}</td>
<td>{{user._alt_created_utc|timestamp}}</td>
<td>{{user._is_manual}}</td>
<td>{{user._alt_deleted}}</td>
<td>
<button type="button" id="delink-alt-{{u.id}}-{{user.id}}" class="btn btn-danger {% if user._alt_deleted %}d-none{% endif %}" onclick="postToastSwitch(this,'/@{{u.username}}/alts/{{user.id}}/deleted', this.id, 'relink-alt-{{u.id}}-{{user.id}}', 'd-none', null, 'PUT')">Delink</button>
<button type="button" id="relink-alt-{{u.id}}-{{user.id}}" class="btn btn-danger {% if not user._alt_deleted %}d-none{% endif %}" onclick="postToastSwitch(this,'/@{{u.username}}/alts/{{user.id}}/deleted', this.id, 'delink-alt-{{u.id}}-{{user.id}}', 'd-none', null, 'DELETE')">Relink</button>
<button type="button" id="delink-alt-{{u.id}}-{{user.id}}" class="btn btn-danger" onclick="postToastSwitch(this,'/@{{u.username}}/alts/{{user.id}}/deleted', this.id, 'relink-alt-{{u.id}}-{{user.id}}', 'd-none', null, 'PUT')">Delink</button>
<button type="button" id="relink-alt-{{u.id}}-{{user.id}}" class="btn btn-danger" onclick="postToastSwitch(this,'/@{{u.username}}/alts/{{user.id}}/deleted', this.id, 'delink-alt-{{u.id}}-{{user.id}}', 'd-none', null, 'DELETE')">Relink</button>
<a class="btn btn-secondary" href="/@{{user.username}}/alts">Alts</a>
{% if v.admin_level >= PERMS['VIEW_ALT_VOTES'] %}
<a class="btn btn-secondary" href="/admin/alt_votes/?u1={{u.username}}&u2={{user.username}}">Alt Votes</a>

View File

@ -225,7 +225,7 @@
<span id="profile--alts">Alts:</span>
{% endif %}
<ul id="profile--alts-list">
{% for account in get_alt_graph(u.id) if not account._alt_deleted and (v.can_see_shadowbanned or not account.shadowbanned) %}
{% for account in get_alt_graph(u.id) if v.can_see_shadowbanned or not account.shadowbanned %}
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
{% endfor %}
</ul>
@ -489,7 +489,7 @@
<span id="profile-mobile--alts">Alts:</span>
{% endif %}
<ul id="profile-mobile--alts-list">
{% for account in get_alt_graph(u.id) if not account._alt_deleted and (v.can_see_shadowbanned or not account.shadowbanned) %}
{% for account in get_alt_graph(u.id) if v.can_see_shadowbanned or not account.shadowbanned %}
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
{% endfor %}
</ul>