diff --git a/files/routes/login.py b/files/routes/login.py index 754469573..8d4da04e6 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -336,7 +336,7 @@ def sign_up_post(v): email=email, created_utc=int(time.time()), referred_by=ref_id or None, - ban_evade = int(any([x.is_banned for x in g.db.query(User).filter(User.id.in_(tuple(session.get("history", [])))).all() if x])), + ban_evade = int(any([x.is_banned and not x.unban_utc for x in g.db.query(User).filter(User.id.in_(tuple(session.get("history", [])))).all() if x])), agendaposter = any([x.agendaposter for x in g.db.query(User).filter(User.id.in_(tuple(session.get("history", [])))).all() if x]) ) diff --git a/files/routes/users.py b/files/routes/users.py index c497b716e..6aa65f08c 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -113,7 +113,7 @@ def messagereply(v, username, id): Comment.sentto == user.id, CommentAux.body == message, ).options(contains_eager(Comment.comment_aux)).first() - if existing: return redirect('/notifications?all=true') + if existing: return redirect('/notifications?messages=true') with CustomRenderer() as renderer: text_html = renderer.render(mistletoe.Document(message)) text_html = sanitize(text_html, linkgen=True) @@ -130,7 +130,7 @@ def messagereply(v, username, id): g.db.add(new_aux) notif = Notification(comment_id=new_comment.id, user_id=user.id) g.db.add(notif) - return redirect('/notifications?all=true') + return redirect('/notifications?messages=true') @app.get("/songs/") def songs(id): @@ -173,7 +173,7 @@ def message2(v, username): Comment.sentto == user.id, CommentAux.body == message, ).options(contains_eager(Comment.comment_aux)).first() - if existing: return redirect('/notifications?all=true') + if existing: return redirect('/notifications?messages=true') send_pm(v.id, user, message) @@ -193,7 +193,7 @@ def message2(v, username): except Exception as e: print(e) - return redirect('/notifications?all=true') + return redirect('/notifications?messages=true') @app.get("/2faqr/") @auth_required