Set ordering on the ConfigRevision to ensure consistency and usage of latest config.
Some checks failed
CI / build (20.x, 3.10) (push) Has been cancelled
CI / build (20.x, 3.11) (push) Has been cancelled
CI / build (20.x, 3.12) (push) Has been cancelled

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