Skip to content

Commit 3db3bb2

Browse files
committed
v2.2.1
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
1 parent cf58ff4 commit 3db3bb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend_api_python/app/services/community_service.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,22 @@ def purchase_indicator(self, buyer_id: int, indicator_id: int) -> Tuple[bool, st
330330

331331
# 6. 复制指标到买家账户
332332
now_ts = int(time.time())
333+
# Get vip_free as boolean from indicator
334+
vip_free_value = bool(indicator.get('vip_free') or False)
333335
cur.execute("""
334336
INSERT INTO qd_indicator_codes
335337
(user_id, is_buy, end_time, name, code, description,
336338
publish_to_community, pricing_type, price, is_encrypted, preview_image, vip_free,
337339
createtime, updatetime, created_at, updated_at)
338-
VALUES (?, 1, 0, ?, ?, ?, 0, 'free', 0, ?, ?, 0, ?, ?, NOW(), NOW())
340+
VALUES (?, 1, 0, ?, ?, ?, 0, 'free', 0, ?, ?, ?, ?, ?, NOW(), NOW())
339341
""", (
340342
buyer_id,
341343
indicator['name'],
342344
indicator['code'],
343345
indicator['description'],
344346
indicator['is_encrypted'] or 0,
345347
indicator['preview_image'],
348+
vip_free_value, # Use boolean value instead of integer 0
346349
now_ts, now_ts
347350
))
348351

0 commit comments

Comments
 (0)