Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1556,7 +1556,9 @@ def add_data_ver_cur2():
|
|
| 1556 |
|
| 1557 |
veref_on_off = request.args.get('ver', '0') # Включает "1" и выключает "0" верификацию номера вместо verifikation_start
|
| 1558 |
curator_on_off = request.args.get('cur', '0') # Включает "1" и выключает "0" назначение куратора
|
| 1559 |
-
|
|
|
|
|
|
|
| 1560 |
template_key = request.args.get('template_key', 'avp')
|
| 1561 |
mapping_template_cur = mapp_templates.get(template_key, mt_avp)
|
| 1562 |
|
|
@@ -1567,7 +1569,7 @@ def add_data_ver_cur2():
|
|
| 1567 |
if curator_on_off == "1":
|
| 1568 |
user_data['curator'] = curators[current_curator_index]
|
| 1569 |
|
| 1570 |
-
if veref_on_off == "
|
| 1571 |
phone_number = user_data.get('phone', '')
|
| 1572 |
if not phone_number:
|
| 1573 |
logging.error("Phone number is empty")
|
|
@@ -1581,10 +1583,14 @@ def add_data_ver_cur2():
|
|
| 1581 |
add_or_update_contact(user_data)
|
| 1582 |
if curator_on_off == "1":
|
| 1583 |
current_curator_index = (current_curator_index + 1) % len(curators)
|
| 1584 |
-
|
| 1585 |
|
| 1586 |
-
|
| 1587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1588 |
except Exception as e:
|
| 1589 |
logging.error(f"Error adding user: {e}")
|
| 1590 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
|
@@ -1611,7 +1617,6 @@ def add_data_ver_cur2():
|
|
| 1611 |
|
| 1612 |
|
| 1613 |
|
| 1614 |
-
|
| 1615 |
|
| 1616 |
|
| 1617 |
def clean_phone_number_ss(phone_number):
|
|
|
|
| 1556 |
|
| 1557 |
veref_on_off = request.args.get('ver', '0') # Включает "1" и выключает "0" верификацию номера вместо verifikation_start
|
| 1558 |
curator_on_off = request.args.get('cur', '0') # Включает "1" и выключает "0" назначение куратора
|
| 1559 |
+
order = request.args.get('order', '')
|
| 1560 |
+
status = request.args.get('status', '')
|
| 1561 |
+
del_flag = request.args.get('del', '')
|
| 1562 |
template_key = request.args.get('template_key', 'avp')
|
| 1563 |
mapping_template_cur = mapp_templates.get(template_key, mt_avp)
|
| 1564 |
|
|
|
|
| 1569 |
if curator_on_off == "1":
|
| 1570 |
user_data['curator'] = curators[current_curator_index]
|
| 1571 |
|
| 1572 |
+
if veref_on_off == "1":
|
| 1573 |
phone_number = user_data.get('phone', '')
|
| 1574 |
if not phone_number:
|
| 1575 |
logging.error("Phone number is empty")
|
|
|
|
| 1583 |
add_or_update_contact(user_data)
|
| 1584 |
if curator_on_off == "1":
|
| 1585 |
current_curator_index = (current_curator_index + 1) % len(curators)
|
|
|
|
| 1586 |
|
| 1587 |
+
response_message = {
|
| 1588 |
+
'status': 'success',
|
| 1589 |
+
'message': f'User added with curator {user_data.get("curator", "not assigned")}'
|
| 1590 |
+
}
|
| 1591 |
+
if status:
|
| 1592 |
+
response_message['status'] = status
|
| 1593 |
+
return jsonify(response_message)
|
| 1594 |
except Exception as e:
|
| 1595 |
logging.error(f"Error adding user: {e}")
|
| 1596 |
return jsonify({'status': 'error', 'message': str(e)}), 500
|
|
|
|
| 1617 |
|
| 1618 |
|
| 1619 |
|
|
|
|
| 1620 |
|
| 1621 |
|
| 1622 |
def clean_phone_number_ss(phone_number):
|