diff --git a/api/tacticalrmm/agents/management/commands/bulk_delete_agents.py b/api/tacticalrmm/agents/management/commands/bulk_delete_agents.py index 74d22d0f..85b1ba88 100644 --- a/api/tacticalrmm/agents/management/commands/bulk_delete_agents.py +++ b/api/tacticalrmm/agents/management/commands/bulk_delete_agents.py @@ -60,7 +60,7 @@ class Command(BaseCommand): ) return - agents = Agent.objects.defer(*AGENT_DEFER) + agents = Agent.objects.select_related("site__client").defer(*AGENT_DEFER) if days: overdue = djangotime.now() - djangotime.timedelta(days=days)