This commit is contained in:
Mateusz Gruszczyński
2025-09-26 22:42:10 +02:00
parent b679700c6d
commit dfa3028dad
6 changed files with 44 additions and 21 deletions

14
app.py
View File

@@ -178,13 +178,13 @@ def load_user(user_id):
@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
try:
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
except Exception:
pass
if dbapi_connection.__class__.__module__.startswith('sqlite3'):
try:
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
except Exception:
pass
def get_real_ip():
headers = request.headers