remove task that's no longer applicable due to recent db changes
This commit is contained in:
parent
6de79922c5
commit
4b37fe12d7
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue