fds
This commit is contained in:
parent
2f41cc6b47
commit
e917df0434
3 changed files with 12 additions and 4 deletions
|
@ -230,6 +230,14 @@ class User(Base):
|
||||||
def age(self):
|
def age(self):
|
||||||
return int(time.time()) - self.created_utc
|
return int(time.time()) - self.created_utc
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def alts_unique(self):
|
||||||
|
alts = []
|
||||||
|
for u in self.alts:
|
||||||
|
if u not in alts: alts.append(u)
|
||||||
|
return alts
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def strid(self):
|
def strid(self):
|
||||||
|
|
|
@ -66,7 +66,7 @@ def club_allow(v, username):
|
||||||
u.club_banned = False
|
u.club_banned = False
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
|
|
||||||
for x in u.alts:
|
for x in u.alts_unique:
|
||||||
x.club_allowed = True
|
x.club_allowed = True
|
||||||
x.club_banned = False
|
x.club_banned = False
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
@ -95,7 +95,7 @@ def club_ban(v, username):
|
||||||
u.club_banned = True
|
u.club_banned = True
|
||||||
u.club_allowed = False
|
u.club_allowed = False
|
||||||
|
|
||||||
for x in u.alts:
|
for x in u.alts_unique:
|
||||||
x.club_banned = True
|
x.club_banned = True
|
||||||
u.club_allowed = False
|
u.club_allowed = False
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
|
|
@ -356,7 +356,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span>Alts:</span>
|
<span>Alts:</span>
|
||||||
<ul>
|
<ul>
|
||||||
{% for account in u.alts %}
|
{% for account in u.alts_unique %}
|
||||||
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
|
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -633,7 +633,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span>Alts:</span>
|
<span>Alts:</span>
|
||||||
<ul>
|
<ul>
|
||||||
{% for account in u.alts %}
|
{% for account in u.alts_unique %}
|
||||||
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
|
<li><a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue