DmitrMakeev
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1681,15 +1681,13 @@ def add_data_ver_cur():
|
|
1681 |
|
1682 |
|
1683 |
|
|
|
|
|
|
|
1684 |
|
1685 |
|
1686 |
|
1687 |
-
|
1688 |
-
DATABASE2 = 'data_gc.db'
|
1689 |
def verify_phone_number2(phone_number):
|
1690 |
-
current_curator_index = 0
|
1691 |
-
verifikation_start = "1" # Глобальная переменная для управления верификацией
|
1692 |
-
|
1693 |
if verifikation_start == "1":
|
1694 |
full_url_ver = f"{wa_url}{wa_ak}{ws_url_ver}{wa_api_key}"
|
1695 |
payload = json.dumps({"phoneNumber": phone_number})
|
@@ -1704,14 +1702,13 @@ def verify_phone_number2(phone_number):
|
|
1704 |
return "false"
|
1705 |
|
1706 |
def insert_data2(data, template_key):
|
|
|
1707 |
conn = sqlite3.connect(DATABASE2)
|
1708 |
cursor = conn.cursor()
|
1709 |
|
1710 |
mapping_template_cur = mapp_templates.get(template_key, mt_avp)
|
1711 |
|
1712 |
for row in data:
|
1713 |
-
verifikation_start = '1'
|
1714 |
-
curator_on_off = '1'
|
1715 |
utc_now = datetime.utcnow()
|
1716 |
msk_tz = pytz.timezone('Europe/Moscow')
|
1717 |
msk_now = utc_now.replace(tzinfo=pytz.utc).astimezone(msk_tz)
|
@@ -1765,8 +1762,7 @@ def insert_data2(data, template_key):
|
|
1765 |
def upload_csv():
|
1766 |
global verifikation_start, curator_on_off
|
1767 |
|
1768 |
-
|
1769 |
-
template_key = 'csv'
|
1770 |
|
1771 |
if 'file' not in request.files:
|
1772 |
return jsonify({"error": "No file part"}), 400
|
@@ -1815,7 +1811,6 @@ def upload_csv():
|
|
1815 |
|
1816 |
|
1817 |
|
1818 |
-
|
1819 |
|
1820 |
|
1821 |
@app.route('/gc_in', methods=['GET'])
|
|
|
1681 |
|
1682 |
|
1683 |
|
1684 |
+
current_curator_index = 0
|
1685 |
+
verifikation_start = "1" # Глобальная переменная для управления верификацией
|
1686 |
+
curator_on_off = "1" # Глобальная переменная для управления назначением куратора
|
1687 |
|
1688 |
|
1689 |
|
|
|
|
|
1690 |
def verify_phone_number2(phone_number):
|
|
|
|
|
|
|
1691 |
if verifikation_start == "1":
|
1692 |
full_url_ver = f"{wa_url}{wa_ak}{ws_url_ver}{wa_api_key}"
|
1693 |
payload = json.dumps({"phoneNumber": phone_number})
|
|
|
1702 |
return "false"
|
1703 |
|
1704 |
def insert_data2(data, template_key):
|
1705 |
+
global current_curator_index
|
1706 |
conn = sqlite3.connect(DATABASE2)
|
1707 |
cursor = conn.cursor()
|
1708 |
|
1709 |
mapping_template_cur = mapp_templates.get(template_key, mt_avp)
|
1710 |
|
1711 |
for row in data:
|
|
|
|
|
1712 |
utc_now = datetime.utcnow()
|
1713 |
msk_tz = pytz.timezone('Europe/Moscow')
|
1714 |
msk_now = utc_now.replace(tzinfo=pytz.utc).astimezone(msk_tz)
|
|
|
1762 |
def upload_csv():
|
1763 |
global verifikation_start, curator_on_off
|
1764 |
|
1765 |
+
template_key = 'avp' # Исправлено на существующий ключ
|
|
|
1766 |
|
1767 |
if 'file' not in request.files:
|
1768 |
return jsonify({"error": "No file part"}), 400
|
|
|
1811 |
|
1812 |
|
1813 |
|
|
|
1814 |
|
1815 |
|
1816 |
@app.route('/gc_in', methods=['GET'])
|