mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-12 14:52:17 -06:00
Set ordering on the ConfigRevision to ensure consistency and usage of latest config.
This commit is contained in:
@@ -78,7 +78,8 @@ class Config:
|
||||
from core.models import ConfigRevision
|
||||
|
||||
try:
|
||||
revision = ConfigRevision.objects.last()
|
||||
# Enforce the creation date as the ordering parameter
|
||||
revision = ConfigRevision.objects.order_by('-created').first()
|
||||
if revision is None:
|
||||
logger.debug("No previous configuration found in database; proceeding with default values")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user