fix: db.session.query(TenantAccountJoin) (#19482)

This commit is contained in:
crazywoola
2025-05-10 19:43:56 +08:00
committed by GitHub
parent af12cf1bf6
commit b29087b680
3 changed files with 24 additions and 11 deletions

View File

@@ -52,7 +52,7 @@ class Account(UserMixin, Base):
@current_tenant.setter
def current_tenant(self, value: "Tenant"):
tenant = value
ta = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=self.id).first()
ta = db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id, account_id=self.id).first()
if ta:
tenant.current_role = ta.role
else: