#!/usr/bin/env python
"""
Check all loan officers
"""
import os
import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'branch_system.settings')
django.setup()

from django.contrib.auth import get_user_model

User = get_user_model()

# Get all loan officers
loan_officers = User.objects.filter(role='loan_officer')

print(f"\n=== All Loan Officers ===")
print(f"Total: {loan_officers.count()}")
for officer in loan_officers:
    branch_name = officer.branch.name if officer.branch else "No branch"
    print(f"  - {officer.get_full_name()} ({officer.email}) - Branch: {branch_name}")
