예제 #1
0
 def get_setting(self, name):
     """Return value for given setting name. May extract from discussion prefs"""
     # TODO: Add WHITELISTED_DOMAINS
     # TODO: Obsolete code: those preferences are gone.
     if name.split("_")[-1] in ('KEY', 'SECRET', 'SERVER'):
         prefs = self.get_preferences()
         backend = prefs["authorization_server_backend"]
         if backend:
             m = re.match((
                 r"^(?:SOCIAL_AUTH_)?(?:%s_)?(KEY|SECRET|SERVER)$"
                 % to_setting_name(backend)), name)
             if m:
                 val = prefs.get("authorization_" + m.group(1).lower(), None)
                 if val is not None:
                     return val
     return super(AppStrategy, self).get_setting(name)
예제 #2
0
 def get_setting(self, name):
     """Return value for given setting name. May extract from discussion prefs"""
     # TODO: Add WHITELISTED_DOMAINS
     # TODO: Obsolete code: those preferences are gone.
     if name.split("_")[-1] in ('KEY', 'SECRET', 'SERVER'):
         prefs = self.get_preferences()
         backend = prefs["authorization_server_backend"]
         if backend:
             m = re.match((
                 r"^(?:SOCIAL_AUTH_)?(?:%s_)?(KEY|SECRET|SERVER)$"
                 % to_setting_name(backend)), name)
             if m:
                 val = prefs.get("authorization_" + m.group(1).lower(), None)
                 if val is not None:
                     return val
     return super(AssemblStrategy, self).get_setting(name)