Bug fix for Event Device related fields. the ID needed to be searchable.

Quick removal of the password from the log output
This commit is contained in:
Scott Idem
2026-01-26 11:56:31 -05:00
parent 061c153061
commit f2420b958d
3 changed files with 9 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ from sqlalchemy import create_engine
from app.config import settings
log = logging.getLogger('root')
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
# 1. Thread-local storage for capturing last SQL error message
_sql_error_state = threading.local()
@@ -57,17 +57,19 @@ def reconnect_db() -> bool:
Useful after bootstrapping new credentials from the 'cfg' table.
"""
global engine, db, db_uri
log.info("DB SQL Core: Refreshing database connection engine...")
try:
if engine:
engine.dispose()
log.info("DB SQL Core: Disposed of previous database engine.")
db_uri = settings.SQLALCHEMY_DB_URI
engine = create_ae_engine(db_uri)
db = engine.connect()
log.info(f"DB SQL Core: Database engine re-established successfully: {db_uri}")
safe_uri = db_uri.split('@')[-1] if '@' in db_uri else db_uri
log.info(f"DB SQL Core: Database engine re-established successfully: {safe_uri}")
return True
except Exception:
log.exception("DB SQL Core: FAILED to refresh database engine!")

View File

@@ -45,11 +45,11 @@ class Event_Device_Base(BaseModel):
api_secret_key: Optional[str]
api_base_url: Optional[str]
app_server_base_url: Optional[str]
app_base_url: Optional[str]
file_server_base_url: Optional[str]
api_base_url_bak: Optional[str] # Backup URL
app_server_base_url_bak: Optional[str] # Backup URL
app_base_url_bak: Optional[str] # Backup URL
file_server_base_url_bak: Optional[str] # Backup URL
trigger_open_filename: Optional[str] # The file hash filename

View File

@@ -92,6 +92,7 @@ events_general_obj_li = {
'base_name': Event_Device_Base,
# V3 Search Security:
'searchable_fields': [
'id', 'event_device_id', 'account_id', 'event_id', 'event_location_id',
'event_device_id_random', 'account_id_random', 'event_id_random',
'event_location_id_random', 'code', 'name', 'description', 'app_mode',
'enable', 'hide', 'priority', 'sort', 'group', 'event_notes', 'notes',