From 22488e93e104f50f68dac6c48695c2b0d3612da8 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 3 Feb 2021 23:23:34 +0000 Subject: [PATCH] approve updates when triggered manually --- api/tacticalrmm/winupdate/tasks.py | 4 ++++ api/tacticalrmm/winupdate/views.py | 1 + 2 files changed, 5 insertions(+) diff --git a/api/tacticalrmm/winupdate/tasks.py b/api/tacticalrmm/winupdate/tasks.py index 54b45c4f..a1ee8f9d 100644 --- a/api/tacticalrmm/winupdate/tasks.py +++ b/api/tacticalrmm/winupdate/tasks.py @@ -129,6 +129,10 @@ def bulk_install_updates_task(pks: List[int]) -> None: for chunk in chunks: for agent in chunk: agent.delete_superseded_updates() + try: + agent.approve_updates() + except: + pass nats_data = { "func": "installwinupdates", "guids": agent.get_approved_update_guids(), diff --git a/api/tacticalrmm/winupdate/views.py b/api/tacticalrmm/winupdate/views.py index 4b5af210..629e94da 100644 --- a/api/tacticalrmm/winupdate/views.py +++ b/api/tacticalrmm/winupdate/views.py @@ -37,6 +37,7 @@ def install_updates(request, pk): if pyver.parse(agent.version) < pyver.parse("1.3.0"): return notify_error("Requires agent version 1.3.0 or greater") + agent.approve_updates() nats_data = { "func": "installwinupdates", "guids": agent.get_approved_update_guids(),