0Learn commited on
Commit
6e4e12c
·
verified ·
1 Parent(s): cf6b61d

Update google_sheets_utils.py

Browse files
Files changed (1) hide show
  1. google_sheets_utils.py +2 -1
google_sheets_utils.py CHANGED
@@ -40,12 +40,13 @@ def get_credentials():
40
  if not config:
41
  return None
42
 
43
- creds_file = config.get('google_sheets_credentials_file')
44
  if not creds_file:
45
  logging.error("Google Sheets credentials file path not found in .env file")
46
  return None
47
 
48
  try:
 
49
  return Credentials.from_service_account_file(creds_file, scopes=SCOPES)
50
  except Exception as e:
51
  logging.error("Error creating credentials: %s", str(e))
 
40
  if not config:
41
  return None
42
 
43
+ creds_json = config.get('google_sheets_credentials_file')
44
  if not creds_file:
45
  logging.error("Google Sheets credentials file path not found in .env file")
46
  return None
47
 
48
  try:
49
+ creds_file = json.loads(creds_json)
50
  return Credentials.from_service_account_file(creds_file, scopes=SCOPES)
51
  except Exception as e:
52
  logging.error("Error creating credentials: %s", str(e))