mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
15192 fix config revision if no revisions
This commit is contained in:
parent
50e5bb9717
commit
9b9afdcf79
@ -44,7 +44,7 @@ class ConfigRevision(models.Model):
|
|||||||
return gettext('Config revision #{id}').format(id=self.pk)
|
return gettext('Config revision #{id}').format(id=self.pk)
|
||||||
|
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
if item in self.data:
|
if self.data and item in self.data:
|
||||||
return self.data[item]
|
return self.data[item]
|
||||||
return super().__getattribute__(item)
|
return super().__getattribute__(item)
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ class ConfigView(generic.ObjectView):
|
|||||||
except ConfigRevision.DoesNotExist:
|
except ConfigRevision.DoesNotExist:
|
||||||
# Fall back to using the active config data if no record is found
|
# Fall back to using the active config data if no record is found
|
||||||
return ConfigRevision(
|
return ConfigRevision(
|
||||||
data=get_config()
|
data=get_config().defaults
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user