add severity field to Update model
This commit is contained in:
parent
ce79421698
commit
3e851cb046
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.7 on 2019-12-02 02:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('winupdate', '0003_auto_20191201_0426'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='winupdate',
|
||||
name='severity',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
]
|
|
@ -11,6 +11,7 @@ class WinUpdate(models.Model):
|
|||
installed = models.BooleanField(default=False)
|
||||
downloaded = models.BooleanField(default=False)
|
||||
description = models.TextField(null=True)
|
||||
severity = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.agent.hostname
|
||||
|
|
|
@ -34,7 +34,8 @@ def check_for_updates_task(pk):
|
|||
needs_reboot=ret[i]["NeedsReboot"],
|
||||
installed=ret[i]["Installed"],
|
||||
downloaded=ret[i]["Downloaded"],
|
||||
description=ret[i]["Description"]
|
||||
description=ret[i]["Description"],
|
||||
severity=ret[i]["Severity"]
|
||||
).save()
|
||||
else:
|
||||
for i in guids:
|
||||
|
@ -58,6 +59,7 @@ def check_for_updates_task(pk):
|
|||
needs_reboot=ret[i]["NeedsReboot"],
|
||||
installed=ret[i]["Installed"],
|
||||
downloaded=ret[i]["Downloaded"],
|
||||
description=ret[i]["Description"]
|
||||
description=ret[i]["Description"],
|
||||
severity=ret[i]["Severity"]
|
||||
).save()
|
||||
return "ok"
|
Loading…
Reference in New Issue