DmitrMakeev
commited on
Commit
•
f551131
1
Parent(s):
56f7792
Update app.py
Browse files
app.py
CHANGED
@@ -173,6 +173,10 @@ def add_data_gc():
|
|
173 |
if not name or not phone or not email:
|
174 |
return "Parameters 'name', 'phone', and 'email' are required.", 400
|
175 |
|
|
|
|
|
|
|
|
|
176 |
conn = sqlite3.connect('data_gc.db')
|
177 |
cursor = conn.cursor()
|
178 |
cursor.execute('SELECT * FROM contacts WHERE phone = ? OR email = ?', (phone, email))
|
|
|
173 |
if not name or not phone or not email:
|
174 |
return "Parameters 'name', 'phone', and 'email' are required.", 400
|
175 |
|
176 |
+
# Очистка номера телефона от плюса, если он есть
|
177 |
+
if phone.startswith('+'):
|
178 |
+
phone = phone[1:]
|
179 |
+
|
180 |
conn = sqlite3.connect('data_gc.db')
|
181 |
cursor = conn.cursor()
|
182 |
cursor.execute('SELECT * FROM contacts WHERE phone = ? OR email = ?', (phone, email))
|