DmitrMakeev commited on
Commit
2a22887
·
verified ·
1 Parent(s): 4980f51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -804,7 +804,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
804
  return
805
 
806
  logging.debug(f"Processing user with email: {email}")
807
-
808
  # Проверка существования пользователя в базе данных по email
809
  cursor.execute("SELECT web_st, b_fin FROM contacts WHERE email = ?", (email,))
810
  user = cursor.fetchone()
@@ -817,7 +817,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
817
  # Проверка текущих значений web_st и b_fin и их инкрементация
818
  current_web_st = user[0] if user[0] is not None and user[0] != "" else 0
819
  current_b_fin = user[1] if user[1] is not None and user[1] != "" else 0
820
-
821
  web_st_value = int(current_web_st) + 1
822
  if user_data.get('finished') == "True":
823
  b_fin_value = int(current_b_fin) + 1
@@ -836,7 +836,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
836
  transformed_data = {}
837
  for json_key, db_column in mapping_template.items():
838
  value = user_data.get(json_key, "")
839
-
840
  if isinstance(value, list):
841
  # Проверяем тип элементов списка
842
  if all(isinstance(item, str) for item in value):
@@ -897,6 +897,7 @@ def update_or_insert_user(db_name, user_data, mapping_template):
897
  logging.debug(f"User with email {email} processed successfully")
898
 
899
 
 
900
  @app.route('/send_get_request', methods=['GET'])
901
  def send_get_request():
902
  token = request.args.get('token')
 
804
  return
805
 
806
  logging.debug(f"Processing user with email: {email}")
807
+
808
  # Проверка существования пользователя в базе данных по email
809
  cursor.execute("SELECT web_st, b_fin FROM contacts WHERE email = ?", (email,))
810
  user = cursor.fetchone()
 
817
  # Проверка текущих значений web_st и b_fin и их инкрементация
818
  current_web_st = user[0] if user[0] is not None and user[0] != "" else 0
819
  current_b_fin = user[1] if user[1] is not None and user[1] != "" else 0
820
+
821
  web_st_value = int(current_web_st) + 1
822
  if user_data.get('finished') == "True":
823
  b_fin_value = int(current_b_fin) + 1
 
836
  transformed_data = {}
837
  for json_key, db_column in mapping_template.items():
838
  value = user_data.get(json_key, "")
839
+
840
  if isinstance(value, list):
841
  # Проверяем тип элементов списка
842
  if all(isinstance(item, str) for item in value):
 
897
  logging.debug(f"User with email {email} processed successfully")
898
 
899
 
900
+
901
  @app.route('/send_get_request', methods=['GET'])
902
  def send_get_request():
903
  token = request.args.get('token')