update pay promo

This commit is contained in:
2026-02-03 16:00:57 +08:00
parent b57cd3019c
commit c0624ea2a2

View File

@@ -1742,7 +1742,12 @@ def update_profile():
user.bio = form.get('bio')
user.gender = form.get('gender')
user.birth_date = datetime.strptime(form.get('birth_date'), '%Y-%m-%d') if form.get('birth_date') else None
user.phone = form.get('phone')
# 手机号更新逻辑:如果已通过微信验证绑定,则不允许通过表单覆盖
# 防止用户更新其他资料时意外清空已绑定的手机号
if not user.phone_confirmed:
phone_value = form.get('phone')
if phone_value is not None:
user.phone = phone_value
user.location = form.get('location')
user.wechat_id = form.get('wechat_id')