From 61f9cd8266a695d57a30bb68f79c27eb4ba758b1 Mon Sep 17 00:00:00 2001 From: Marcus Furlong Date: Wed, 19 Jun 2024 17:53:36 -0400 Subject: [PATCH] better handle attrs in reports --- reports/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reports/models.py b/reports/models.py index 7fdc7fb1..442e8008 100644 --- a/reports/models.py +++ b/reports/models.py @@ -86,9 +86,12 @@ def parse(self, data, meta): 'reboot'] for attr in attrs: - setattr(self, attr, data.get(attr).strip()) + if data.get(attr): + setattr(self, attr, data.get(attr)) + else: + setattr(self, attr, '') - if self.host is not None: + if self.host: self.host = self.host.lower() fqdn = self.host.split('.', 1) if len(fqdn) == 2: