Fix for #1573
This commit is contained in:
parent
1535bdbcd8
commit
0cc07362b8
@ -602,8 +602,12 @@ def get_error_text(client_secrets=None):
|
||||
if not os.path.isfile(CLIENT_SECRETS):
|
||||
return 'client_secrets.json is missing or not readable'
|
||||
|
||||
with open(CLIENT_SECRETS, 'r') as settings:
|
||||
filedata = json.load(settings)
|
||||
try:
|
||||
with open(CLIENT_SECRETS, 'r') as settings:
|
||||
filedata = json.load(settings)
|
||||
except PermissionError:
|
||||
return 'client_secrets.json is missing or not readable'
|
||||
|
||||
if 'web' not in filedata:
|
||||
return 'client_secrets.json is not configured for web application'
|
||||
if 'redirect_uris' not in filedata['web']:
|
||||
|
@ -287,7 +287,7 @@ if ub.oauth_support:
|
||||
flash(_(u"Unlink to %(oauth)s Failed", oauth=oauth_check[provider]), category="error")
|
||||
except NoResultFound:
|
||||
log.warning("oauth %s for user %d not found", provider, current_user.id)
|
||||
flash(_(u"Not Linked to %(oauth)s.", oauth=oauth_check[provider]), category="error")
|
||||
flash(_(u"Not Linked to %(oauth)s", oauth=provider), category="error")
|
||||
return redirect(url_for('web.profile'))
|
||||
|
||||
|
||||
@ -355,4 +355,4 @@ if ub.oauth_support:
|
||||
@oauth.route('/unlink/google', methods=["GET"])
|
||||
@login_required
|
||||
def google_login_unlink():
|
||||
return unlink_oauth(oauthblueprints[1]['blueprint'].name)
|
||||
return unlink_oauth(oauthblueprints[1]['id'])
|
||||
|
@ -30,20 +30,20 @@
|
||||
<div data-related="gdrive_settings">
|
||||
{% if gdriveError %}
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<label id="gdrive_error">
|
||||
{{_('Google Drive config problem')}}: {{ gdriveError }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if show_authenticate_google_drive and g.user.is_authenticated and config.config_use_google_drive %}
|
||||
<div class="form-group required">
|
||||
<a href="{{ url_for('gdrive.authenticate_google_drive') }}" class="btn btn-primary">{{_('Authenticate Google Drive')}}</a>
|
||||
<a href="{{ url_for('gdrive.authenticate_google_drive') }}" id="gdrive_auth" class="btn btn-primary">{{_('Authenticate Google Drive')}}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if show_authenticate_google_drive and g.user.is_authenticated and not config.config_use_google_drive %}
|
||||
<div >{{_('Please hit save to continue with setup')}}</div>
|
||||
{% endif %}
|
||||
{% if not g.user.is_authenticated %}
|
||||
{% if not g.user.is_authenticated and show_login_button %}
|
||||
<div >{{_('Please finish Google Drive setup after login')}}</div>
|
||||
{% endif %}
|
||||
{% if g.user.is_authenticated %}
|
||||
|
Loading…
Reference in New Issue
Block a user