From 1307f63225d2c695d755137e406b7c00207d214a Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 25 Oct 2024 16:04:11 +0800 Subject: [PATCH] . --- app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index e9d18b5..2be5c24 100644 --- a/app.py +++ b/app.py @@ -162,7 +162,10 @@ def update_customers(index): email["owner's name"] = updated_data.get(f'{domain}_owner_name_{j}', [email["owner's name"]])[0] email['email address'] = updated_data.get(f'{domain}_email_address_{j}', [email['email address']])[0] email['category'] = updated_data.get(f'{domain}_category_{j}', [email['category']])[0] - email['promotion history'] = updated_data.get(f'{domain}_promotion_history_{j}', [', '.join(email['promotion history'])])[0].split(', ') + #email['promotion history'] = updated_data.get(f'{domain}_promotion_history_{j}', [', '.join(email['promotion history'])])[0].split(', ') + if 'promotion history' in email: + email['promotion history'] = updated_data.get(f'{domain}_promotion_history_{j}', [', '.join(email['promotion history'])])[0].split(', ') + # 如果 'promotion history' 不存在,什么都不做,直接跳过 # 将更新后的数据保存到 ES 数据库 store_to_es(key, buf, 'customer')