diff --git a/files/classes/user.py b/files/classes/user.py index 7e3ff1c6d..6dbe13959 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -230,6 +230,14 @@ class User(Base): def age(self): 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 @lazy def strid(self): diff --git a/files/routes/admin.py b/files/routes/admin.py index b05f7bf9f..edfb63b48 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -66,7 +66,7 @@ def club_allow(v, username): u.club_banned = False g.db.add(u) - for x in u.alts: + for x in u.alts_unique: x.club_allowed = True x.club_banned = False g.db.add(x) @@ -95,7 +95,7 @@ def club_ban(v, username): u.club_banned = True u.club_allowed = False - for x in u.alts: + for x in u.alts_unique: x.club_banned = True u.club_allowed = False g.db.add(x) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 5bd38902d..6cc48d865 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -356,7 +356,7 @@ {% endif %} Alts: @@ -633,7 +633,7 @@ {% endif %} Alts: