views: add setting for FC scopes

This commit is contained in:
Benjamin Dauvergne 2017-07-26 19:06:40 +02:00
parent 8aed0278c3
commit d5c76ccee0
2 changed files with 8 additions and 1 deletions

View File

@ -104,6 +104,10 @@ class AppSettings(object):
def fd_list(self):
return self._setting('FD_LIST', {})
@property
def scopes(self):
return self._setting('SCOPES', [])
import sys

View File

@ -187,7 +187,10 @@ class FcOAuthSessionViewMixin(LoggerMixin):
return self.redirect(request, next_url=there, *args, **kwargs)
def get_scopes(self):
return self.scopes
if app_settings.scopes:
return list(set(['openid'] + app_settings.scopes))
else:
return self.scopes
def get_ressource(self, url, verify):
try: