chore(db): use a better way to export models and remove unused table (#11838)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2024-12-20 14:12:29 +08:00 • committed by GitHub
commit 3599751f93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 206 additions and 91 deletions

View file

@ -1,6 +1,5 @@
import base64
from extensions.ext_database import db
from libs import rsa
@ -14,6 +13,7 @@ def obfuscated_token(token: str):
def encrypt_token(tenant_id: str, token: str):
from models.account import Tenant
from models.engine import db
if not (tenant := db.session.query(Tenant).filter(Tenant.id == tenant_id).first()):
raise ValueError(f"Tenant with id {tenant_id} not found")