CBV01 commited on
Commit
937a3b2
·
1 Parent(s): 1947db2

Critical Fix: Remove last_active column crash breaking ALL Telegram connections. Remove debug test files.

Browse files
Files changed (3) hide show
  1. backend/main.py +1 -1
  2. test_500.py +0 -25
  3. test_db.py +0 -0
backend/main.py CHANGED
@@ -314,7 +314,7 @@ class TelegramPool:
314
  except: pass
315
 
316
  conn = get_db_connection()
317
- conn.execute("UPDATE accounts SET status = 'active', last_active = ? WHERE phone_number = ?", (datetime.now(), phone_number))
318
  if hasattr(conn, "commit"): conn.commit()
319
  if hasattr(conn, "close"): conn.close()
320
 
 
314
  except: pass
315
 
316
  conn = get_db_connection()
317
+ conn.execute("UPDATE accounts SET status = 'active' WHERE phone_number = ?", (phone_number,))
318
  if hasattr(conn, "commit"): conn.commit()
319
  if hasattr(conn, "close"): conn.close()
320
 
test_500.py DELETED
@@ -1,25 +0,0 @@
1
- import os
2
- import sys
3
- from dotenv import load_dotenv # type: ignore
4
-
5
- load_dotenv("backend/.env")
6
-
7
- def test_accounts():
8
- sys.path.append(os.path.join(os.getcwd(), 'backend'))
9
- from database import get_db_connection # type: ignore
10
- conn = get_db_connection()
11
- try:
12
- rows = conn.execute("""
13
- SELECT phone_number, status, api_id, api_hash,
14
- first_name, last_name, username, profile_photo, country, created_at
15
- FROM accounts
16
- """).fetchall()
17
- print("Success! Got rows:", len(rows))
18
- for r in rows:
19
- print(r)
20
- except Exception as e:
21
- import traceback
22
- traceback.print_exc()
23
-
24
- if __name__ == "__main__":
25
- test_accounts()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
test_db.py ADDED
Binary file (268 Bytes). View file