Spaces:
Runtime error
Runtime error
DmitrMakeev
commited on
Commit
•
6b46630
1
Parent(s):
370dfa6
Update app.py
Browse files
app.py
CHANGED
@@ -1781,7 +1781,7 @@ def clean_phone_number_j(phone_number):
|
|
1781 |
return re.sub(r'\D', '', phone_number)
|
1782 |
|
1783 |
# Функция для вставки данных в базу данных
|
1784 |
-
def
|
1785 |
conn = sqlite3.connect(DATABASE) # Подключаемся к базе данных
|
1786 |
cursor = conn.cursor()
|
1787 |
|
@@ -1833,7 +1833,7 @@ def upload_json():
|
|
1833 |
return jsonify({"error": "No selected file"}), 400
|
1834 |
if file and file.filename.endswith('.json'):
|
1835 |
data = json.load(file)
|
1836 |
-
|
1837 |
return jsonify({"message": "Data uploaded and inserted successfully"})
|
1838 |
return jsonify({"error": "Invalid file format"}), 400
|
1839 |
|
|
|
1781 |
return re.sub(r'\D', '', phone_number)
|
1782 |
|
1783 |
# Функция для вставки данных в базу данных
|
1784 |
+
def insert_data_j(data):
|
1785 |
conn = sqlite3.connect(DATABASE) # Подключаемся к базе данных
|
1786 |
cursor = conn.cursor()
|
1787 |
|
|
|
1833 |
return jsonify({"error": "No selected file"}), 400
|
1834 |
if file and file.filename.endswith('.json'):
|
1835 |
data = json.load(file)
|
1836 |
+
insert_data_j(data)
|
1837 |
return jsonify({"message": "Data uploaded and inserted successfully"})
|
1838 |
return jsonify({"error": "Invalid file format"}), 400
|
1839 |
|