DmitrMakeev commited on
Commit
36875a8
1 Parent(s): c4c9979

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -196,7 +196,11 @@ mapping_template = {
196
 
197
 
198
 
199
-
 
 
 
 
200
 
201
 
202
 
@@ -1604,11 +1608,18 @@ def add_data_ver_cur():
1604
 
1605
  user_data = {mapping_template_cur[key]: request.args.get(key, "") for key in mapping_template_cur}
1606
 
 
 
1607
  if curator_on_off == "1":
1608
  user_data['curator'] = curators[current_curator_index]
1609
 
1610
  if veref_on_off == "1":
1611
- phone_verification_response = verify_phone_number_test(user_data.get('phone', ''))
 
 
 
 
 
1612
  if phone_verification_response is not None:
1613
  user_data['ws_st'] = phone_verification_response
1614
 
@@ -1632,8 +1643,6 @@ def add_data_ver_cur():
1632
 
1633
 
1634
 
1635
-
1636
-
1637
  DATABASE2 = 'data_gc.db'
1638
 
1639
  def verify_phone_number(phone_number):
 
196
 
197
 
198
 
199
+ mapping_template_cur = {
200
+ 'name': 'Name',
201
+ 'phone': 'Phone',
202
+ 'email': 'Email'
203
+ }
204
 
205
 
206
 
 
1608
 
1609
  user_data = {mapping_template_cur[key]: request.args.get(key, "") for key in mapping_template_cur}
1610
 
1611
+ logging.debug(f"Received data: {user_data}")
1612
+
1613
  if curator_on_off == "1":
1614
  user_data['curator'] = curators[current_curator_index]
1615
 
1616
  if veref_on_off == "1":
1617
+ phone_number = user_data.get('phone', '')
1618
+ if not phone_number:
1619
+ logging.error("Phone number is empty")
1620
+ return jsonify({'status': 'error', 'message': 'Phone number is empty'}), 400
1621
+
1622
+ phone_verification_response = verify_phone_number_test(phone_number)
1623
  if phone_verification_response is not None:
1624
  user_data['ws_st'] = phone_verification_response
1625
 
 
1643
 
1644
 
1645
 
 
 
1646
  DATABASE2 = 'data_gc.db'
1647
 
1648
  def verify_phone_number(phone_number):