fix: multiple rows were found correctly (#2219)

This commit is contained in:
crazywoola 2024-01-26 12:47:42 +08:00 committed by GitHub
commit 828822243a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 49 additions and 48 deletions

View file

@ -101,7 +101,10 @@ class Account(UserMixin, db.Model):
return db.session.query(ai).filter(
ai.account_id == self.id
).all()
# check current_user.current_tenant.current_role in ['admin', 'owner']
@property
def is_admin_or_owner(self):
return self._current_tenant.current_role in ['admin', 'owner']
class Tenant(db.Model):
__tablename__ = 'tenants'