fix(settings): fix route ordering and settings page display of DB values

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-23 11:39:13 +00:00
parent c95c144410
commit ec7a35e747
2 changed files with 144 additions and 144 deletions
+5 -5
View File
@@ -72,25 +72,25 @@ async def settings_page(request: Request, db: Session = Depends(get_db)):
for category, keys in categories.items():
settings_data[category] = []
for key in keys:
# Get current value from settings (already has precedence applied)
value = getattr(settings, key, None)
# Determine the source of this setting
# Check if it's in the database
# Determine the source of this setting and get the effective value
# Check if it's in the database (DB takes precedence)
if key in db_settings:
source = "database"
source_label = "DB"
source_color = "green"
value = db_settings[key]
# Check if it's from environment variable
elif key.upper() in os.environ or key in os.environ:
source = "environment"
source_label = "ENV"
source_color = "blue"
value = getattr(settings, key, None)
else:
# It's using the default value
source = "default"
source_label = "DEFAULT"
source_color = "gray"
value = getattr(settings, key, None)
# Get metadata
metadata = get_setting_metadata(key)