diff --git a/api/tacticalrmm/core/tasks.py b/api/tacticalrmm/core/tasks.py index 54f03e16..960793c0 100644 --- a/api/tacticalrmm/core/tasks.py +++ b/api/tacticalrmm/core/tasks.py @@ -4,8 +4,6 @@ from loguru import logger from django.conf import settings from django.utils import timezone as djangotime from tacticalrmm.celery import app -from accounts.models import User -from agents.models import Agent from autotasks.models import AutomatedTask from autotasks.tasks import delete_win_task_schedule @@ -14,15 +12,6 @@ logger.configure(**settings.LOG_CONFIG) @app.task def core_maintenance_tasks(): - # cleanup any leftover agent user accounts - agents = Agent.objects.values_list("agent_id", flat=True) - users = User.objects.exclude(username__in=agents).filter(last_login=None) - if users: - users.delete() - logger.info( - "Removed leftover agent user accounts:", str([i.username for i in users]) - ) - # cleanup expired runonce tasks tasks = AutomatedTask.objects.filter( task_type="runonce",