Update app.py
Browse files
app.py
CHANGED
|
@@ -1626,9 +1626,7 @@ def gc_forms():
|
|
| 1626 |
|
| 1627 |
|
| 1628 |
|
| 1629 |
-
|
| 1630 |
-
import requests
|
| 1631 |
-
import json
|
| 1632 |
|
| 1633 |
def verify_phone_number(phone_number):
|
| 1634 |
verifikation_start = "1"
|
|
@@ -1677,10 +1675,9 @@ def verify_phone_number(phone_number):
|
|
| 1677 |
print("Verification not started")
|
| 1678 |
return "Verification not started"
|
| 1679 |
|
| 1680 |
-
|
| 1681 |
# Функция для добавления или обновления контакта в базе данных
|
| 1682 |
def add_or_update_contact(contact_data):
|
| 1683 |
-
conn = sqlite3.connect(
|
| 1684 |
cursor = conn.cursor()
|
| 1685 |
|
| 1686 |
email = contact_data.get('email')
|
|
@@ -1716,7 +1713,7 @@ def add_data_ver():
|
|
| 1716 |
|
| 1717 |
phone_verification_response = verify_phone_number(contact_data['phone'])
|
| 1718 |
if phone_verification_response is not None:
|
| 1719 |
-
contact_data['
|
| 1720 |
|
| 1721 |
try:
|
| 1722 |
add_or_update_contact(contact_data)
|
|
@@ -1738,7 +1735,6 @@ def add_data_ver():
|
|
| 1738 |
|
| 1739 |
|
| 1740 |
|
| 1741 |
-
|
| 1742 |
initialize_requests()
|
| 1743 |
|
| 1744 |
|
|
|
|
| 1626 |
|
| 1627 |
|
| 1628 |
|
| 1629 |
+
DATABASE_NAME3 = 'data_gc.db'
|
|
|
|
|
|
|
| 1630 |
|
| 1631 |
def verify_phone_number(phone_number):
|
| 1632 |
verifikation_start = "1"
|
|
|
|
| 1675 |
print("Verification not started")
|
| 1676 |
return "Verification not started"
|
| 1677 |
|
|
|
|
| 1678 |
# Функция для добавления или обновления контакта в базе данных
|
| 1679 |
def add_or_update_contact(contact_data):
|
| 1680 |
+
conn = sqlite3.connect(DATABASE_NAME3)
|
| 1681 |
cursor = conn.cursor()
|
| 1682 |
|
| 1683 |
email = contact_data.get('email')
|
|
|
|
| 1713 |
|
| 1714 |
phone_verification_response = verify_phone_number(contact_data['phone'])
|
| 1715 |
if phone_verification_response is not None:
|
| 1716 |
+
contact_data['ws_st'] = phone_verification_response # Сохраняем значение в поле ws_st
|
| 1717 |
|
| 1718 |
try:
|
| 1719 |
add_or_update_contact(contact_data)
|
|
|
|
| 1735 |
|
| 1736 |
|
| 1737 |
|
|
|
|
| 1738 |
initialize_requests()
|
| 1739 |
|
| 1740 |
|