diff --git a/backend/python/app/api/admin/dashboard.py b/backend/python/app/api/admin/dashboard.py index 729ad2a..9f99f28 100644 --- a/backend/python/app/api/admin/dashboard.py +++ b/backend/python/app/api/admin/dashboard.py @@ -85,12 +85,14 @@ async def get_recent_logs( def _format_cst(dt_value): - """Format UTC naive datetime to CST ISO string""" + """Format datetime to CST ISO string. + DB values are written by cst_now() as CST time (stored naive by MySQL). + No UTC conversion needed - treat naive values as CST directly. + """ if dt_value is None: return None - utc_dt = dt_value.replace(tzinfo=timezone.utc) - cst_dt = utc_dt.astimezone(CST_TZ) - return cst_dt.isoformat() + # DB naive values are already CST (written by cst_now()), just attach tz + return dt_value.replace(tzinfo=CST_TZ).isoformat() @router.get("/recent-audit") async def get_recent_audit( @@ -117,9 +119,11 @@ async def get_recent_audit( def _format_cst(dt_value): - """Format UTC naive datetime to CST ISO string""" + """Format datetime to CST ISO string. + DB values are written by cst_now() as CST time (stored naive by MySQL). + No UTC conversion needed - treat naive values as CST directly. + """ if dt_value is None: return None - utc_dt = dt_value.replace(tzinfo=timezone.utc) - cst_dt = utc_dt.astimezone(CST_TZ) - return cst_dt.isoformat() \ No newline at end of file + # DB naive values are already CST (written by cst_now()), just attach tz + return dt_value.replace(tzinfo=CST_TZ).isoformat() \ No newline at end of file diff --git a/backend/python/app/api/market.py b/backend/python/app/api/market.py index fa2e862..7f07b82 100644 --- a/backend/python/app/api/market.py +++ b/backend/python/app/api/market.py @@ -387,9 +387,6 @@ def uninstall_app( app.install_count = app.install_count - 1 # 将应用状态标记为未安装(对于skill类型) - if app.type == "skill" and app.is_active: - app.is_active = False - app.updated_at = datetime.now() db.commit() diff --git a/backend/python/app/api/token_usage.py b/backend/python/app/api/token_usage.py index b547162..5256ac1 100644 --- a/backend/python/app/api/token_usage.py +++ b/backend/python/app/api/token_usage.py @@ -252,10 +252,11 @@ def recharge( def _format_cst_time(dt_value): - """Format datetime to CST ISO string. Input is UTC naive datetime from DB.""" + """Format datetime to CST ISO string. + DB values are written by cst_now() as CST time (stored naive by MySQL). + No UTC conversion needed - treat naive values as CST directly. + """ if dt_value is None: return None - # DB stores UTC naive datetime, convert to CST - utc_dt = dt_value.replace(tzinfo=timezone.utc) - cst_dt = utc_dt.astimezone(CST_TZ) - return cst_dt.isoformat() + # DB naive values are already CST (written by cst_now()), just attach tz + return dt_value.replace(tzinfo=CST_TZ).isoformat()