forgot to check core settings fixes
@@ -3,6 +3,7 @@ from django.core.management.base import BaseCommand
from packaging import version as pyver
from agents.models import Agent
+from core.models import CoreSettings
from agents.tasks import send_agent_update_task
from tacticalrmm.utils import AGENT_DEFER
@@ -11,6 +12,10 @@ class Command(BaseCommand):
help = "Triggers an agent update task to run"
def handle(self, *args, **kwargs):
+ core = CoreSettings.objects.first()
+ if not core.agent_auto_update: # type: ignore
+ return
+
q = Agent.objects.defer(*AGENT_DEFER).exclude(version=settings.LATEST_AGENT_VER)
agent_ids: list[str] = [
i.agent_id
