diff --git a/netbox/core/models/config.py b/netbox/core/models/config.py index 6c8e41477..b2381ae40 100644 --- a/netbox/core/models/config.py +++ b/netbox/core/models/config.py @@ -44,7 +44,7 @@ class ConfigRevision(models.Model): return gettext('Config revision #{id}').format(id=self.pk) def __getattr__(self, item): - if item in self.data: + if self.data and item in self.data: return self.data[item] return super().__getattribute__(item) diff --git a/netbox/core/views.py b/netbox/core/views.py index 537c33d9d..6c87087f2 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -166,7 +166,7 @@ class ConfigView(generic.ObjectView): except ConfigRevision.DoesNotExist: # Fall back to using the active config data if no record is found return ConfigRevision( - data=get_config() + data=get_config().defaults )