DmitrMakeev commited on
Commit
a2b39aa
1 Parent(s): 537148d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -886,6 +886,7 @@ def update_or_insert_user_biz(db_name, user_data, mapping_template):
886
  # Верификация номера телефона
887
  if 'phone' in user_data and verifikation_start == "1":
888
  phone_verification_result = verify_phone_number_biz(transformed_data['phone'])
 
889
  if phone_verification_result == "true":
890
  transformed_data['ws_st'] = "True"
891
  else:
@@ -896,6 +897,7 @@ def update_or_insert_user_biz(db_name, user_data, mapping_template):
896
  global current_curator_index
897
  transformed_data['curator'] = curators[current_curator_index]
898
  current_curator_index = (current_curator_index + 1) % len(curators)
 
899
 
900
  if user:
901
  update_query = "UPDATE contacts SET "
@@ -919,8 +921,8 @@ def update_or_insert_user_biz(db_name, user_data, mapping_template):
919
  conn.close()
920
  logging.debug(f"User with email {email} processed successfully")
921
 
922
- @app.route('/send_get_request', methods=['GET'])
923
- def send_get_request_biz():
924
  token = request.args.get('token')
925
  webinarId = request.args.get('webinarId')
926
  url = f'https://online.bizon365.ru/api/v1/webinars/reports/get?webinarId={webinarId}'
@@ -967,8 +969,8 @@ def send_get_request_biz():
967
  except requests.exceptions.RequestException as e:
968
  return jsonify({'error': f'API request failed: {str(e)}'}), 500
969
 
970
- @app.route('/webhookbz', methods=['POST'])
971
- def webhookbz_biz():
972
  api_sys_control = request.args.get('api_sys')
973
  if api_sys_control != api_key_sys:
974
  return "EUR 22", 200
 
886
  # Верификация номера телефона
887
  if 'phone' in user_data and verifikation_start == "1":
888
  phone_verification_result = verify_phone_number_biz(transformed_data['phone'])
889
+ logging.debug(f"Phone verification result for {email}: {phone_verification_result}") # Логирование результата верификации
890
  if phone_verification_result == "true":
891
  transformed_data['ws_st'] = "True"
892
  else:
 
897
  global current_curator_index
898
  transformed_data['curator'] = curators[current_curator_index]
899
  current_curator_index = (current_curator_index + 1) % len(curators)
900
+ logging.debug(f"Curator assigned for {email}: {transformed_data['curator']}") # Логирование назначенного куратора
901
 
902
  if user:
903
  update_query = "UPDATE contacts SET "
 
921
  conn.close()
922
  logging.debug(f"User with email {email} processed successfully")
923
 
924
+ @app.route('/send_get_request_biz', methods=['GET'])
925
+ def send_get_request():
926
  token = request.args.get('token')
927
  webinarId = request.args.get('webinarId')
928
  url = f'https://online.bizon365.ru/api/v1/webinars/reports/get?webinarId={webinarId}'
 
969
  except requests.exceptions.RequestException as e:
970
  return jsonify({'error': f'API request failed: {str(e)}'}), 500
971
 
972
+ @app.route('/webhookbz_biz', methods=['POST'])
973
+ def webhookbz():
974
  api_sys_control = request.args.get('api_sys')
975
  if api_sys_control != api_key_sys:
976
  return "EUR 22", 200