diff --git a/app/routes/auth.py b/app/routes/auth.py index f6aeae4..cbc8ec6 100644 --- a/app/routes/auth.py +++ b/app/routes/auth.py @@ -129,7 +129,15 @@ def profile(): @login_required @admin_required def list_users(): - users = User.query.order_by(User.created_at.desc()).all() + # Exclude customer accounts — those are managed exclusively via /customers + users = ( + User.query + .filter(User.role != 'customer') + .order_by(User.created_at.desc()) + .all() + ) + logger.info('AUTH | list_users | admin=%s | internal_users_count=%s', + current_user.username, len(users)) return render_template('auth/users.html', users=users) diff --git a/app/templates/auth/users.html b/app/templates/auth/users.html index 9487e93..3406e67 100644 --- a/app/templates/auth/users.html +++ b/app/templates/auth/users.html @@ -3,11 +3,12 @@ {% block title %}User Management{% endblock %} {% block content %} -
Manage staff accounts (Admin, Supervisor, Inspector, Project Manager). For customer accounts, visit Customer Management.