Fix for gdrive not working #1081
This commit is contained in:
parent
78f9ee86b1
commit
8af178c19c
|
@ -272,6 +272,8 @@ def _configuration_update_helper():
|
||||||
gdrive_secrets = {}
|
gdrive_secrets = {}
|
||||||
gdriveError = gdriveutils.get_error_text(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:
|
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:
|
if not gdrive_secrets:
|
||||||
return _configuration_result('client_secrets.json is not configured for web application')
|
return _configuration_result('client_secrets.json is not configured for web application')
|
||||||
gdriveutils.update_settings(
|
gdriveutils.update_settings(
|
||||||
|
@ -413,6 +415,7 @@ def _configuration_result(error_flash=None, gdriveError=None):
|
||||||
if gdriveError:
|
if gdriveError:
|
||||||
gdriveError = _(gdriveError)
|
gdriveError = _(gdriveError)
|
||||||
else:
|
else:
|
||||||
|
if config.config_use_google_drive and not gdrive_authenticate:
|
||||||
gdrivefolders = gdriveutils.listRootFolders()
|
gdrivefolders = gdriveutils.listRootFolders()
|
||||||
|
|
||||||
show_back_button = current_user.is_authenticated
|
show_back_button = current_user.is_authenticated
|
||||||
|
|
|
@ -584,5 +584,7 @@ def get_error_text(client_secrets=None):
|
||||||
filedata = json.load(settings)
|
filedata = json.load(settings)
|
||||||
if 'web' not in filedata:
|
if 'web' not in filedata:
|
||||||
return 'client_secrets.json is not configured for web application'
|
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:
|
if client_secrets:
|
||||||
client_secrets.update(filedata['web'])
|
client_secrets.update(filedata['web'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user