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

This commit is contained in:
crazywoola 2025-05-10 19:43:56 +08:00 committed by GitHub
commit b29087b680
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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: