fix: 二次迁移名额有剩余次数即展示入口,不依赖强制拦截

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-29 04:19:25 +08:00
parent b84bdc5a76
commit 5f3a5f9e08

View File

@@ -709,9 +709,10 @@ def gate_for_user(*, club_id: str, user_uid: str, roles: Optional[List[str]] = N
if roles:
role_hit = any(r in force_roles for r in roles)
has_assets = user_has_migratable_assets(plan, user_uid)
# 白名单角色下完全无资产:不强制、不展示入口
# 强制:仍要有可迁资产(空资产别拦死首页)
# 入口:只要还有剩余次数就展示(含二次名额),不必依赖第一次强制拦截
force = bool(plan.force_intercept and role_hit and not done and has_assets)
show_entry = bool(has_assets and not done)
show_entry = bool(not done)
return {
'active': True,
'force': force,