DmitrMakeev
commited on
Commit
•
bff098a
1
Parent(s):
915d4b4
Update app.py
Browse files
app.py
CHANGED
@@ -684,7 +684,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
|
|
684 |
required_fields = [
|
685 |
"vk_id", "chat_id", "ws_st", "ws_stop", "web_st", "fin_prog",
|
686 |
"b_city", "b_fin", "b_ban", "b_ign", "b_baners", "b_butt", "b_mess",
|
687 |
-
"shop_st", "curator", "pr1", "pr2", "pr3", "pr4", "pr5", "
|
688 |
"key_pr", "n_con", "canal", "data_t", 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'
|
689 |
]
|
690 |
for field in required_fields:
|
@@ -1459,7 +1459,7 @@ def add_or_update_contact(contact_data):
|
|
1459 |
fields = [
|
1460 |
'name', 'phone', 'email', 'vk_id', 'chat_id', 'ws_st', 'ws_stop', 'web_st', 'fin_prog',
|
1461 |
'b_city', 'b_fin', 'b_ban', 'b_ign', 'b_baners', 'b_butt', 'b_mess', 'shop_st', 'curator',
|
1462 |
-
'pr1', 'pr2', 'pr3', 'pr4', 'pr5', '
|
1463 |
]
|
1464 |
|
1465 |
placeholders = ", ".join([f"{field} = ?" for field in fields])
|
@@ -1567,8 +1567,8 @@ def insert_data(data, verify_phone, add_curator):
|
|
1567 |
else:
|
1568 |
ws_st = row.get('ws_st', '')
|
1569 |
|
1570 |
-
columns = ['name', 'phone', 'email', 'vk_id', 'chat_id', 'ws_st', 'ws_stop', 'web_st', 'fin_prog', 'b_city', 'b_fin', 'b_ban', 'b_ign', 'b_baners', 'b_butt', 'b_mess', 'shop_st', 'curator', 'pr1', 'pr2', 'pr3', 'pr4', 'pr5', '
|
1571 |
-
values = [name, phone, email, row.get('vk_id', ''), row.get('chat_id', ''), ws_st, row.get('ws_stop', ''), row.get('web_st', 0), row.get('fin_prog', 0), row.get('b_city', ''), row.get('b_fin', ''), row.get('b_ban', ''), row.get('b_ign', ''), row.get('b_baners', ''), row.get('b_butt', ''), row.get('b_mess', ''), row.get('shop_st', ''), curator, row.get('pr1', ''), row.get('pr2', ''), row.get('pr3', ''), row.get('pr4', ''), row.get('pr5', ''), row.get('
|
1572 |
|
1573 |
placeholders = ', '.join(['?' for _ in columns])
|
1574 |
columns_str = ', '.join(columns)
|
|
|
684 |
required_fields = [
|
685 |
"vk_id", "chat_id", "ws_st", "ws_stop", "web_st", "fin_prog",
|
686 |
"b_city", "b_fin", "b_ban", "b_ign", "b_baners", "b_butt", "b_mess",
|
687 |
+
"shop_st", "curator", "pr1", "pr2", "pr3", "pr4", "pr5", "gc_url",
|
688 |
"key_pr", "n_con", "canal", "data_t", 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'
|
689 |
]
|
690 |
for field in required_fields:
|
|
|
1459 |
fields = [
|
1460 |
'name', 'phone', 'email', 'vk_id', 'chat_id', 'ws_st', 'ws_stop', 'web_st', 'fin_prog',
|
1461 |
'b_city', 'b_fin', 'b_ban', 'b_ign', 'b_baners', 'b_butt', 'b_mess', 'shop_st', 'curator',
|
1462 |
+
'pr1', 'pr2', 'pr3', 'pr4', 'pr5', 'gc_url', 'key_pr', 'n_con', 'canal', 'data_t', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'
|
1463 |
]
|
1464 |
|
1465 |
placeholders = ", ".join([f"{field} = ?" for field in fields])
|
|
|
1567 |
else:
|
1568 |
ws_st = row.get('ws_st', '')
|
1569 |
|
1570 |
+
columns = ['name', 'phone', 'email', 'vk_id', 'chat_id', 'ws_st', 'ws_stop', 'web_st', 'fin_prog', 'b_city', 'b_fin', 'b_ban', 'b_ign', 'b_baners', 'b_butt', 'b_mess', 'shop_st', 'curator', 'pr1', 'pr2', 'pr3', 'pr4', 'pr5', 'gc_url', 'key_pr', 'n_con', 'canal', 'data_t', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']
|
1571 |
+
values = [name, phone, email, row.get('vk_id', ''), row.get('chat_id', ''), ws_st, row.get('ws_stop', ''), row.get('web_st', 0), row.get('fin_prog', 0), row.get('b_city', ''), row.get('b_fin', ''), row.get('b_ban', ''), row.get('b_ign', ''), row.get('b_baners', ''), row.get('b_butt', ''), row.get('b_mess', ''), row.get('shop_st', ''), curator, row.get('pr1', ''), row.get('pr2', ''), row.get('pr3', ''), row.get('pr4', ''), row.get('pr5', ''), row.get('gc_url', ''), row.get('key_pr', ''), row.get('n_con', ''), row.get('canal', ''), data_t, row.get('utm_source', ''), row.get('utm_medium', ''), row.get('utm_campaign', ''), row.get('utm_term', ''), row.get('utm_content', '')]
|
1572 |
|
1573 |
placeholders = ', '.join(['?' for _ in columns])
|
1574 |
columns_str = ', '.join(columns)
|