Skip to content

Commit c91ff56

Browse files
ThranduilThranduil
authored andcommitted
fix(legal): add default user agreement + privacy policy to branding config
The /api/settings/brand-config endpoint was returning empty legal fields (user_agreement_url, privacy_policy_url, user_agreement_text, privacy_policy_text all blank). This is a compliance gap for a trading platform handling real funds. - branding.py: add legal defaults to BRAND_DEFAULTS (summary text + URLs pointing to /legal/user-agreement and /legal/privacy-policy), so the public brand-config API returns non-empty legal metadata out of the box - env.example: fill in the BRAND_LEGAL_* defaults so operators see the expected values
1 parent e64e1c2 commit c91ff56

2 files changed

Lines changed: 34 additions & 8 deletions

File tree

backend_api_python/app/services/settings/branding.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
"social_discord": "https://discord.com/invite/tyx5B6TChr",
1919
"social_telegram": "https://t.me/quantdinger",
2020
"social_youtube": "https://youtube.com/@quantdinger",
21+
"legal_user_agreement_url": "/legal/user-agreement",
22+
"legal_user_agreement_text": (
23+
"QuantDinger 用户协议(摘要)。本平台为量化研究、回测与自动化交易提供基础设施,"
24+
"所有 AI 产出仅供研究参考,不构成任何投资建议。用户使用本平台进行实盘交易的风险"
25+
"由用户自行承担。对接第三方券商/交易所前,用户须确认已阅读该平台的服务条款与"
26+
"风险规则。严禁使用本平台从事任何违法违规交易活动。"
27+
),
28+
"legal_privacy_policy_url": "/legal/privacy-policy",
29+
"legal_privacy_policy_text": (
30+
"隐私政策(摘要)。QuantDinger 仅收集为提供服务所必需的最少数据,包括登录凭证、"
31+
"券商 API 授权信息(加密存储)、会话与操作日志。除法律强制要求外,我们不会向"
32+
"第三方出售用户数据。用户可随时申请导出或删除其数据。券商 API Key/Secret "
33+
"采用 AES-256 加密存储,前端仅展示掩码。"
34+
),
2135
}
2236

2337

@@ -50,10 +64,22 @@ def build_brand_config(app_version: str) -> Dict[str, object]:
5064
},
5165
"social_accounts": social_accounts,
5266
"legal": {
53-
"user_agreement_url": brand_env("BRAND_LEGAL_USER_AGREEMENT_URL"),
54-
"user_agreement_text": brand_env("BRAND_LEGAL_USER_AGREEMENT_TEXT"),
55-
"privacy_policy_url": brand_env("BRAND_LEGAL_PRIVACY_POLICY_URL"),
56-
"privacy_policy_text": brand_env("BRAND_LEGAL_PRIVACY_POLICY_TEXT"),
67+
"user_agreement_url": brand_env(
68+
"BRAND_LEGAL_USER_AGREEMENT_URL",
69+
"legal_user_agreement_url",
70+
),
71+
"user_agreement_text": brand_env(
72+
"BRAND_LEGAL_USER_AGREEMENT_TEXT",
73+
"legal_user_agreement_text",
74+
),
75+
"privacy_policy_url": brand_env(
76+
"BRAND_LEGAL_PRIVACY_POLICY_URL",
77+
"legal_privacy_policy_url",
78+
),
79+
"privacy_policy_text": brand_env(
80+
"BRAND_LEGAL_PRIVACY_POLICY_TEXT",
81+
"legal_privacy_policy_text",
82+
),
5783
},
5884
"mobile_app": {
5985
"latest_version": brand_env("MOBILE_APP_LATEST_VERSION"),

backend_api_python/env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ BRAND_SOCIAL_YOUTUBE=https://youtube.com/@quantdinger
3737

3838
# Legal: external URL takes priority; if both URL and inline text are empty,
3939
# the frontend falls back to the built-in i18n copy.
40-
BRAND_LEGAL_USER_AGREEMENT_URL=
41-
BRAND_LEGAL_USER_AGREEMENT_TEXT=
42-
BRAND_LEGAL_PRIVACY_POLICY_URL=
43-
BRAND_LEGAL_PRIVACY_POLICY_TEXT=
40+
BRAND_LEGAL_USER_AGREEMENT_URL=/legal/user-agreement
41+
BRAND_LEGAL_USER_AGREEMENT_TEXT=QuantDinger 用户协议(摘要)。本平台为量化研究、回测与自动化交易提供基础设施,所有 AI 产出仅供研究参考,不构成任何投资建议。用户使用本平台进行实盘交易的风险由用户自行承担。对接第三方券商/交易所前,用户须确认已阅读该平台的服务条款与风险规则。严禁使用本平台从事任何违法违规交易活动。
42+
BRAND_LEGAL_PRIVACY_POLICY_URL=/legal/privacy-policy
43+
BRAND_LEGAL_PRIVACY_POLICY_TEXT=隐私政策(摘要)。QuantDinger 仅收集为提供服务所必需的最少数据,包括登录凭证、券商 API 授权信息(加密存储)、会话与操作日志。除法律强制要求外,我们不会向第三方出售用户数据。用户可随时申请导出或删除其数据。券商 API Key/Secret 采用 AES-256 加密存储,前端仅展示掩码。
4444

4545
# =========================
4646
# Auth (required)

0 commit comments

Comments
 (0)