Refactored flask.session.get usage
This commit is contained in:
parent
6deda82869
commit
341126dc15
1 changed files with 4 additions and 8 deletions
|
@ -73,17 +73,13 @@ class CAS(object):
|
|||
|
||||
@property
|
||||
def username(self):
|
||||
if self.app.config['CAS_USERNAME_SESSION_KEY'] in flask.session:
|
||||
return flask.session.get(self.app.config['CAS_USERNAME_SESSION_KEY'])
|
||||
else:
|
||||
return None
|
||||
return flask.session.get(
|
||||
self.app.config['CAS_USERNAME_SESSION_KEY'], None)
|
||||
|
||||
@property
|
||||
def attributes(self):
|
||||
if self.app.config['CAS_ATTRIBUTES_SESSION_KEY'] in flask.session:
|
||||
return flask.session.get(self.app.config['CAS_ATTRIBUTES_SESSION_KEY'])
|
||||
else:
|
||||
return None
|
||||
return flask.session.get(
|
||||
self.app.config['CAS_ATTRIBUTES_SESSION_KEY'], None)
|
||||
|
||||
@property
|
||||
def token(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue