forked from rDrama/rDrama
1
0
Fork 0

simplify punished listings

master
Aevann1 2022-12-14 00:29:56 +02:00
parent 8bc8546089
commit b923776e71
4 changed files with 4 additions and 25 deletions

View File

@ -340,14 +340,7 @@ def shadowbanned(v):
users = g.db.query(User) \
.filter(
User.shadowbanned != None,
User.truescore > 0,
not_(and_(
User.profileurl.startswith('/e/'),
User.customtitle==None,
User.namecolor == DEFAULT_COLOR,
User.patron == 0,
User.truescore < 100,
))
User.truescore >= 100,
) \
.order_by(nullslast(User.last_active.desc())).all()

View File

@ -173,15 +173,8 @@ def user_voted_comments(v:User, username):
def banned(v:User):
users = g.db.query(User).filter(
User.is_banned != None,
User.truescore > 0,
or_(User.unban_utc == 0, User.unban_utc > time.time()),
not_(and_(
User.profileurl.startswith('/e/'),
User.customtitle==None,
User.namecolor == DEFAULT_COLOR,
User.patron == 0,
User.truescore < 100,
))
User.truescore >= 100,
)
if v.admin_level >= PERMS['VIEW_LAST_ACTIVE']:
users = users.order_by(nullslast(User.last_active.desc()))
@ -206,15 +199,7 @@ def grassed(v:User):
@auth_required
def chuds(v:User):
users = g.db.query(User).filter(
User.truescore > 0,
or_(User.agendaposter == 1, User.agendaposter > time.time()),
not_(and_(
User.profileurl.startswith('/e/'),
User.customtitle==None,
User.namecolor == DEFAULT_COLOR,
User.patron == 0,
User.truescore < 100,
))
)
if v.admin_level >= PERMS['VIEW_LAST_ACTIVE']:
users = users.order_by(nullslast(User.last_active.desc()))

View File

@ -2,6 +2,7 @@
{% block pagetitle %}Shadowbanned Users{% endblock %}
{% block content %}
<h5 class="my-4">Shadowbanned Users (>= 100 Truscore)</h5>
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -2,7 +2,7 @@
{% block pagetitle %}Banned Users{% endblock %}
{% block content %}
<h5 class="my-4">Banned Users</h5>
<h5 class="my-4">Banned Users (>= 100 Truscore)</h5>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>