DmitrMakeev commited on
Commit
172efa1
1 Parent(s): dd19af7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -25
app.py CHANGED
@@ -1709,38 +1709,42 @@ def add_or_update_contact(contact_data):
1709
 
1710
  @app.route('/add_data_ver', methods=['GET'])
1711
  def add_data_ver():
1712
- # Define all possible fields
1713
  contact_data = {
1714
  'name': request.args.get('name', ''),
1715
  'phone': request.args.get('phone', ''),
1716
  'email': request.args.get('email', ''),
1717
- 'ws_st': '', # Initialize ws_st and other optional fields
1718
- 'fin_prog': '',
1719
- 'b_city': '',
1720
- 'b_fin': '',
1721
- 'b_ban': '',
1722
- 'b_ign': '',
1723
- 'b_baners': '',
1724
- 'b_butt': '',
1725
- 'b_mess': '',
1726
- 'shop_st': '',
1727
- 'curator': '',
1728
- 'pr1': '',
1729
- 'pr2': '',
1730
- 'pr3': '',
1731
- 'pr4': '',
1732
- 'pr5': '',
1733
- 'ad_url': '',
1734
- 'key_pr': '',
1735
- 'n_con': '',
1736
- 'canal': '',
1737
- 'data_t': ''
 
 
 
 
1738
  }
1739
 
1740
- # Verify phone number and update contact_data
1741
  phone_verification_response = verify_phone_number(contact_data['phone'])
1742
  if phone_verification_response is not None:
1743
- contact_data['ws_st'] = phone_verification_response # Update ws_st with verification response
1744
 
1745
  try:
1746
  add_or_update_contact(contact_data)
@@ -1763,7 +1767,6 @@ def add_data_ver():
1763
 
1764
 
1765
 
1766
-
1767
  initialize_requests()
1768
 
1769
 
 
1709
 
1710
  @app.route('/add_data_ver', methods=['GET'])
1711
  def add_data_ver():
1712
+ # Извлечение параметров запроса с дефолтными значениями пустой строки
1713
  contact_data = {
1714
  'name': request.args.get('name', ''),
1715
  'phone': request.args.get('phone', ''),
1716
  'email': request.args.get('email', ''),
1717
+ 'vk_id': request.args.get('vk_id', ''),
1718
+ 'chat_id': request.args.get('chat_id', ''),
1719
+ 'ws_st': request.args.get('ws_st', ''),
1720
+ 'ws_stop': request.args.get('ws_stop', ''),
1721
+ 'web_st': request.args.get('web_st', ''),
1722
+ 'fin_prog': request.args.get('fin_prog', ''),
1723
+ 'b_city': request.args.get('b_city', ''),
1724
+ 'b_fin': request.args.get('b_fin', ''),
1725
+ 'b_ban': request.args.get('b_ban', ''),
1726
+ 'b_ign': request.args.get('b_ign', ''),
1727
+ 'b_baners': request.args.get('b_baners', ''),
1728
+ 'b_butt': request.args.get('b_butt', ''),
1729
+ 'b_mess': request.args.get('b_mess', ''),
1730
+ 'shop_st': request.args.get('shop_st', ''),
1731
+ 'curator': request.args.get('curator', ''),
1732
+ 'pr1': request.args.get('pr1', ''),
1733
+ 'pr2': request.args.get('pr2', ''),
1734
+ 'pr3': request.args.get('pr3', ''),
1735
+ 'pr4': request.args.get('pr4', ''),
1736
+ 'pr5': request.args.get('pr5', ''),
1737
+ 'ad_url': request.args.get('ad_url', ''),
1738
+ 'key_pr': request.args.get('key_pr', ''),
1739
+ 'n_con': request.args.get('n_con', ''),
1740
+ 'canal': request.args.get('canal', ''),
1741
+ 'data_t': request.args.get('data_t', '')
1742
  }
1743
 
1744
+ # Получение значения проверки номера телефона
1745
  phone_verification_response = verify_phone_number(contact_data['phone'])
1746
  if phone_verification_response is not None:
1747
+ contact_data['ws_st'] = phone_verification_response # Сохраняем значение в поле ws_st
1748
 
1749
  try:
1750
  add_or_update_contact(contact_data)
 
1767
 
1768
 
1769
 
 
1770
  initialize_requests()
1771
 
1772