Set ordering on the ConfigRevision to ensure consistency and usage of latest config.

This commit is contained in:
Daniel Sheppard 2025-09-09 09:42:23 -05:00
parent 663f9a223d
commit 9854c66194

View File

@ -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