Update app.py
Browse files
app.py
CHANGED
|
@@ -1528,8 +1528,11 @@ def add_data_ver_cur():
|
|
| 1528 |
|
| 1529 |
if curator_on_off == "1":
|
| 1530 |
user_data['curator'] = curators[current_curator_index]
|
|
|
|
|
|
|
|
|
|
| 1531 |
|
| 1532 |
-
if veref_on_off == "
|
| 1533 |
phone_number = user_data.get('phone', '')
|
| 1534 |
if not phone_number:
|
| 1535 |
logging.error("Phone number is empty")
|
|
@@ -1537,13 +1540,12 @@ def add_data_ver_cur():
|
|
| 1537 |
|
| 1538 |
phone_verification_response = verify_phone_number(phone_number)
|
| 1539 |
if phone_verification_response is not None:
|
| 1540 |
-
user_data['ws_st'] = phone_verification_response
|
|
|
|
|
|
|
| 1541 |
|
| 1542 |
try:
|
| 1543 |
add_or_update_contact(user_data)
|
| 1544 |
-
if curator_on_off == "1":
|
| 1545 |
-
current_curator_index = (current_curator_index + 1) % len(curators)
|
| 1546 |
-
|
| 1547 |
return jsonify({'status': 'success', 'message': f'User added with curator {user_data.get("curator", "not assigned")}'})
|
| 1548 |
except Exception as e:
|
| 1549 |
logging.error(f"Error adding user: {e}")
|
|
|
|
| 1528 |
|
| 1529 |
if curator_on_off == "1":
|
| 1530 |
user_data['curator'] = curators[current_curator_index]
|
| 1531 |
+
current_curator_index = (current_curator_index + 1) % len(curators)
|
| 1532 |
+
else:
|
| 1533 |
+
user_data['curator'] = user_data.get('curator', '')
|
| 1534 |
|
| 1535 |
+
if veref_on_off == "1":
|
| 1536 |
phone_number = user_data.get('phone', '')
|
| 1537 |
if not phone_number:
|
| 1538 |
logging.error("Phone number is empty")
|
|
|
|
| 1540 |
|
| 1541 |
phone_verification_response = verify_phone_number(phone_number)
|
| 1542 |
if phone_verification_response is not None:
|
| 1543 |
+
user_data['ws_st'] = '1' if phone_verification_response else '0'
|
| 1544 |
+
else:
|
| 1545 |
+
user_data['ws_st'] = user_data.get('ws_st', '')
|
| 1546 |
|
| 1547 |
try:
|
| 1548 |
add_or_update_contact(user_data)
|
|
|
|
|
|
|
|
|
|
| 1549 |
return jsonify({'status': 'success', 'message': f'User added with curator {user_data.get("curator", "not assigned")}'})
|
| 1550 |
except Exception as e:
|
| 1551 |
logging.error(f"Error adding user: {e}")
|