File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
- import os
2
1
import json
2
+ import os
3
3
import random
4
4
import re
5
5
import string
@@ -34,9 +34,8 @@ def absolute_uri(self, path=None) -> str:
34
34
return path
35
35
36
36
def get_setting (self , name ) -> Any :
37
- """ settings from environment """
38
37
value = os .getenv (name )
39
- if value == None :
38
+ if value is None :
40
39
raise KeyError
41
40
return value
42
41
@@ -69,8 +68,8 @@ def __init__(self, client: OAuth2Client) -> None:
69
68
self .provider = client .backend .name
70
69
self .redirect_uri = client .redirect_uri
71
70
self .backend = client .backend (OAuth2Strategy ())
72
- self ._authorization_endpoint = self .backend .authorization_url () if hasattr ( self .backend , ' authorization_url' ) else self . backend . AUTHORIZATION_URL
73
- self ._token_endpoint = self .backend .access_token_url () if hasattr ( self .backend , ' access_token_url' ) else self . backend . ACCESS_TOKEN_URL
71
+ self ._authorization_endpoint = client .backend .AUTHORIZATION_URL or self .backend . authorization_url ()
72
+ self ._token_endpoint = client .backend .ACCESS_TOKEN_URL or self .backend . access_token_url ()
74
73
self ._oauth_client = WebApplicationClient (self .client_id )
75
74
76
75
@property
You can’t perform that action at this time.
0 commit comments