Spaces:
Sleeping
Sleeping
Commit ·
426e2a0
1
Parent(s): 18fce40
fixes
Browse files- app/api/v1/auth.py +5 -0
- app/api/v1/endpoints/schema.py +2 -2
app/api/v1/auth.py
CHANGED
|
@@ -2,6 +2,11 @@
|
|
| 2 |
from fastapi import APIRouter, HTTPException, status, Depends
|
| 3 |
from pydantic import BaseModel
|
| 4 |
import sqlite3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
from passlib.context import CryptContext
|
| 6 |
from fastapi.security import OAuth2PasswordRequestForm
|
| 7 |
|
|
|
|
| 2 |
from fastapi import APIRouter, HTTPException, status, Depends
|
| 3 |
from pydantic import BaseModel
|
| 4 |
import sqlite3
|
| 5 |
+
import bcrypt
|
| 6 |
+
if not hasattr(bcrypt, "__about__"):
|
| 7 |
+
class DummyAbout:
|
| 8 |
+
__version__ = getattr(bcrypt, "__version__", "4.0.0")
|
| 9 |
+
bcrypt.__about__ = DummyAbout()
|
| 10 |
from passlib.context import CryptContext
|
| 11 |
from fastapi.security import OAuth2PasswordRequestForm
|
| 12 |
|
app/api/v1/endpoints/schema.py
CHANGED
|
@@ -54,9 +54,9 @@ async def update_indexing(request: TableIndexingRequest):
|
|
| 54 |
detail="Database connection is not established. Please set up the connection first."
|
| 55 |
)
|
| 56 |
try:
|
| 57 |
-
#
|
| 58 |
sql_agent.allowed_tables = request.table_names
|
| 59 |
-
sql_agent.db.allowed_tables = request.table_names
|
| 60 |
return {"message": "Indexing updated successfully for the specified tables."}
|
| 61 |
except Exception as e:
|
| 62 |
raise HTTPException(
|
|
|
|
| 54 |
detail="Database connection is not established. Please set up the connection first."
|
| 55 |
)
|
| 56 |
try:
|
| 57 |
+
# Set allowed tables on the agent and the database wrapper
|
| 58 |
sql_agent.allowed_tables = request.table_names
|
| 59 |
+
sql_agent.db.allowed_tables = request.table_names
|
| 60 |
return {"message": "Indexing updated successfully for the specified tables."}
|
| 61 |
except Exception as e:
|
| 62 |
raise HTTPException(
|