fix: ingest 落库 SDK timezone 到 Visitor.timezone_name(Task16 联调发现)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,9 @@ def _geo_field(g, key):
|
||||
|
||||
def _touch_visitor(site, vid, ctx, ip):
|
||||
env = {k: str(ctx.get(k, "") or "")[:n] for k, n in _FIELD_LEN.items()}
|
||||
# Task16 联调发现:键名映射缺口——SDK context 发 "timezone",模型字段是 timezone_name,
|
||||
# 同名推导的 _FIELD_LEN 取不到值,导致 timezone_name 恒空。
|
||||
env["timezone_name"] = str(ctx.get("timezone", "") or "")[:64]
|
||||
v, created = Visitor.objects.get_or_create(
|
||||
site=site, visitor_id=vid, defaults={**env, "last_ip": ip})
|
||||
now = timezone.now()
|
||||
|
||||
Reference in New Issue
Block a user