bad attitude users - filter by recently active

This commit is contained in:
rimu 2024-06-12 08:12:44 +08:00
parent 7de1fd7891
commit d5355c6a00

View file

@ -538,7 +538,7 @@ def admin_users_trash():
users = users.order_by(User.reputation).paginate(page=page, per_page=1000, error_out=False)
elif type == 'bad_attitude':
users = users.filter(User.last_seen > utcnow() - timedelta(days=7))
users = users.filter(User.attitude < 0.0)
users = users.filter(User.attitude < 0.0).filter(User.reputation < -10)
users = users.order_by(User.attitude).paginate(page=page, per_page=1000, error_out=False)
next_url = url_for('admin.admin_users_trash', page=users.next_num, search=search, local_remote=local_remote, type=type) if users.has_next else None