Commit 8af178c1 authored by Ozzieisaacs's avatar Ozzieisaacs

Fix for gdrive not working #1081

parent 78f9ee86
......@@ -272,6 +272,8 @@ def _configuration_update_helper():
gdrive_secrets = {}
gdriveError = gdriveutils.get_error_text(gdrive_secrets)
if "config_use_google_drive" in to_save and not config.config_use_google_drive and not gdriveError:
with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
gdrive_secrets = json.load(settings)['web']
if not gdrive_secrets:
return _configuration_result('client_secrets.json is not configured for web application')
gdriveutils.update_settings(
......@@ -413,6 +415,7 @@ def _configuration_result(error_flash=None, gdriveError=None):
if gdriveError:
gdriveError = _(gdriveError)
else:
if config.config_use_google_drive and not gdrive_authenticate:
gdrivefolders = gdriveutils.listRootFolders()
show_back_button = current_user.is_authenticated
......
......@@ -584,5 +584,7 @@ def get_error_text(client_secrets=None):
filedata = json.load(settings)
if 'web' not in filedata:
return 'client_secrets.json is not configured for web application'
if 'redirect_uris' not in filedata['web']:
return 'Callback url (redirect url) is missing in client_secrets.json'
if client_secrets:
client_secrets.update(filedata['web'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment