fix: 不让空的或上月学时盖住首页,会话失效后停止重连
This commit is contained in:
@@ -129,7 +129,11 @@ def assemble(account, live: dict | None = None, now: datetime | None = None) ->
|
||||
payload["active"] = running
|
||||
payload["started"] = running
|
||||
cached_hours = str(info.get("month_hours") or "")
|
||||
payload["month_hours"] = cached_hours or str(getattr(account, "month_hours", "") or "")
|
||||
stored_hours = str(getattr(account, "month_hours", "") or "")
|
||||
recorded_month = str(getattr(account, "hours_month", "") or "")
|
||||
if recorded_month and recorded_month != month_key(now):
|
||||
stored_hours = ""
|
||||
payload["month_hours"] = cached_hours or stored_hours
|
||||
try:
|
||||
payload["monthly_target"] = int(getattr(account, "monthly_target", 0) or 0)
|
||||
except (TypeError, ValueError):
|
||||
|
||||
Reference in New Issue
Block a user