docs: 明确迁移入口仅随计划启用,与强制拦截解耦
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -925,8 +925,8 @@ 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)
|
||||
# 强制:仍要有可迁资产(空资产别拦死首页)
|
||||
# 入口:只要还有剩余次数就展示(含二次名额),不必依赖第一次强制拦截
|
||||
# 关后台「启用」→ find_active 找不到计划 → 上面已全 false,前端零感知
|
||||
# 开「启用」:源店可展示入口;「强制拦截」只控制是否自动跳,两者独立
|
||||
force = bool(plan.force_intercept and role_hit and not done and has_assets)
|
||||
show_entry = bool(not done)
|
||||
return {
|
||||
@@ -940,6 +940,7 @@ def gate_for_user(*, club_id: str, user_uid: str, roles: Optional[List[str]] = N
|
||||
'from_club_id': plan.from_club_id,
|
||||
'to_club_id': plan.to_club_id,
|
||||
'force_roles': force_roles,
|
||||
'force_intercept': bool(plan.force_intercept),
|
||||
'success_count': success_count(plan.plan_id, user_uid),
|
||||
'max_allowed': max_allowed_success(plan, user_uid),
|
||||
'is_target': False,
|
||||
|
||||
Reference in New Issue
Block a user