Add mature_content property to Anonymous class

pull/278/head
Jonathan Rehm 7 years ago
parent 91cdb5f60f
commit 08d0404e9c

@ -167,13 +167,14 @@ class Anonymous(AnonymousUserMixin, UserBase):
self.loadSettings() self.loadSettings()
def loadSettings(self): def loadSettings(self):
data = session.query(User).filter(User.role.op('&')(ROLE_ANONYMOUS) == ROLE_ANONYMOUS).first() data = session.query(User).filter(User.role.op('&')(ROLE_ANONYMOUS) == ROLE_ANONYMOUS).first() # type: User
settings = session.query(Settings).first() settings = session.query(Settings).first()
self.nickname = data.nickname self.nickname = data.nickname
self.role = data.role self.role = data.role
self.sidebar_view = data.sidebar_view self.sidebar_view = data.sidebar_view
self.default_language = data.default_language self.default_language = data.default_language
self.locale = data.locale self.locale = data.locale
self.mature_content = data.mature_content
self.anon_browse = settings.config_anonbrowse self.anon_browse = settings.config_anonbrowse
def role_admin(self): def role_admin(self):

Loading…
Cancel
Save