DmitrMakeev
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ def init_db(db_name):
|
|
79 |
web_st INTEGER,
|
80 |
fin_prog INTEGER,
|
81 |
b_city TEXT,
|
82 |
-
b_fin
|
83 |
b_ban TEXT,
|
84 |
b_ign TEXT,
|
85 |
b_baners TEXT,
|
@@ -828,16 +828,10 @@ def update_or_insert_user(db_name, user_data, mapping_template):
|
|
828 |
# Обновление значений web_st и b_fin
|
829 |
cursor.execute("UPDATE contacts SET web_st = ?, b_fin = ? WHERE email = ?", (web_st_value, b_fin_value, email))
|
830 |
conn.commit()
|
831 |
-
conn.close()
|
832 |
logging.debug(f"User {email} web_st updated to {web_st_value}, b_fin updated to {b_fin_value}")
|
833 |
else:
|
834 |
-
conn.close()
|
835 |
logging.debug(f"User {email} not found, proceeding with insert")
|
836 |
|
837 |
-
# Открываем соединение снова для остальных операций
|
838 |
-
conn = sqlite3.connect(db_name)
|
839 |
-
cursor = conn.cursor()
|
840 |
-
|
841 |
# Преобразование данных пользователя на основе шаблона сопоставления
|
842 |
transformed_data = {}
|
843 |
for json_key, db_column in mapping_template.items():
|
|
|
79 |
web_st INTEGER,
|
80 |
fin_prog INTEGER,
|
81 |
b_city TEXT,
|
82 |
+
b_fin INTEGER, -- Изменено на INTEGER
|
83 |
b_ban TEXT,
|
84 |
b_ign TEXT,
|
85 |
b_baners TEXT,
|
|
|
828 |
# Обновление значений web_st и b_fin
|
829 |
cursor.execute("UPDATE contacts SET web_st = ?, b_fin = ? WHERE email = ?", (web_st_value, b_fin_value, email))
|
830 |
conn.commit()
|
|
|
831 |
logging.debug(f"User {email} web_st updated to {web_st_value}, b_fin updated to {b_fin_value}")
|
832 |
else:
|
|
|
833 |
logging.debug(f"User {email} not found, proceeding with insert")
|
834 |
|
|
|
|
|
|
|
|
|
835 |
# Преобразование данных пользователя на основе шаблона сопоставления
|
836 |
transformed_data = {}
|
837 |
for json_key, db_column in mapping_template.items():
|