Correct tenant in session using to_dict
This commit is contained in:
@@ -28,6 +28,16 @@ class Tenant(db.Model):
|
||||
def __repr__(self):
|
||||
return '<Tenant %r>' % self.name
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.name,
|
||||
'website': self.website,
|
||||
'license_start_date': self.license_start_date,
|
||||
'license_end_date': self.license_end_date,
|
||||
'allowed_monthly_interactions': self.allowed_monthly_interactions
|
||||
}
|
||||
|
||||
|
||||
class Role(db.Model, RoleMixin):
|
||||
__bind_key__ = 'public'
|
||||
@@ -85,4 +95,3 @@ class User(db.Model, UserMixin):
|
||||
|
||||
def has_roles(self, *args):
|
||||
return any(role.name in args for role in self.roles)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user