diff --git a/files/routes/login.py b/files/routes/login.py index 699620447e..a625edbd91 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -25,12 +25,15 @@ def login_get(v): def check_for_alts(current_id): + ids = tuple(x[0] for x in g.db.query(User.id).all()) past_accs = set(session.get("history", [])) - past_accs.add(current_id) - session["history"] = list(past_accs) - for past_id in session["history"]: + for past_id in past_accs: + if past_id not in ids: + past_accs.remove(past_id) + continue + if past_id == MOM_ID or current_id == MOM_ID: break if past_id == current_id: continue @@ -75,6 +78,9 @@ def check_for_alts(current_id): new_alt = Alt(user1=a.user2, user2=current_id) g.db.add(new_alt) g.db.flush() + + past_accs.add(current_id) + session["history"] = list(past_accs) @app.post("/login") diff --git a/files/templates/comments.html b/files/templates/comments.html index d1d0789a58..681ea07422 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -233,7 +233,7 @@ 👻 {% else %} {% if SITE_NAME=='Drama' and c.author.house %} - + House {{c.author.house}} {% endif %} {% if c.author.verified %} diff --git a/files/templates/submission.html b/files/templates/submission.html index c9662da8df..fbe5141de4 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -519,7 +519,7 @@ 👻 {% else %} {% if SITE_NAME=='Drama' and p.author.house %} - + House {{p.author.house}} {% endif %} {% if p.author.verified %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 50ac4f6a9a..783a8af298 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -190,7 +190,7 @@ 👻 {% else %} {% if SITE_NAME=='Drama' and p.author.house %} - + House {{p.author.house}} {% endif %} {% if p.author.verified %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 40a02e1d32..2706478120 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -58,7 +58,7 @@ {% endif %} {% if SITE_NAME=='Drama' and u.house %} - + House {{u.house}} {% endif %} {% if u.verified %}{% endif %} @@ -366,7 +366,7 @@ {% if u.unban_utc %}
>{{u.unban_string}}
{% endif %} {% endif %} {% if SITE_NAME=='Drama' and u.house %} - + House {{u.house}} {% endif %} {% if u.verified %} {% endif %}