approve updates when triggered manually

This commit is contained in:
wh1te909 2021-02-03 23:23:34 +00:00
parent 244b89f035
commit 22488e93e1
2 changed files with 5 additions and 0 deletions

View File

@ -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(),

View File

@ -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(),