2026.06.05 frontend javítgatás és új belépési logika megvalósítva
This commit is contained in:
@@ -81,7 +81,7 @@ class ConfigService:
|
||||
Returns:
|
||||
A talált érték (a megfelelő típusban) vagy a default.
|
||||
"""
|
||||
from sqlalchemy import select, and_, cast, String
|
||||
from sqlalchemy import select, and_, cast, String, Text
|
||||
|
||||
try:
|
||||
# Convert scope_level to string for comparison - handle both Enum and string
|
||||
@@ -91,12 +91,12 @@ class ConfigService:
|
||||
scope_str = str(scope_level)
|
||||
|
||||
# Build query with case-insensitive comparison for scope_level
|
||||
# Use ilike or lower() for case-insensitive comparison since enum values might have inconsistent casing
|
||||
# Use cast to Text (not String) to avoid asyncpg enum codec cache issues
|
||||
from sqlalchemy import func
|
||||
query = select(SystemParameter).where(
|
||||
and_(
|
||||
SystemParameter.key == key,
|
||||
func.lower(cast(SystemParameter.scope_level, String)) == scope_str.lower(),
|
||||
func.lower(cast(SystemParameter.scope_level, Text)) == scope_str.lower(),
|
||||
SystemParameter.is_active == True
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user