File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,19 +25,11 @@ def get_credentials(): # pragma: no cover
2525 """
2626 SCOPE = ["https://www.googleapis.com/auth/drive" ]
2727
28- json_env = os .getenv ("GOOGLE_DRIVE_CREDENTIALS_JSON" )
28+ CRED = os .getenv ("GOOGLE_DRIVE_SERVICE_ACCOUNT_CREDS" )
29+ if not CRED :
30+ raise RuntimeError ("Google Drive Service Accounts Creds not found" )
2931
30- if not json_env :
31- raise ImproperlyConfigured (
32- "No Drive credentials found in environment variables."
33- )
34-
35- try :
36- info = json .loads (json_env )
37- except json .JSONDecodeError :
38- raise ImproperlyConfigured ("env doesn't contain a valid JSON" )
39-
40- creds = service_account .Credentials .from_service_account_info (info , scopes = SCOPE )
32+ creds = service_account .Credentials .from_service_account_file (CRED , scopes = SCOPE )
4133
4234 return creds
4335
You can’t perform that action at this time.
0 commit comments