diff --git a/cps/gdriveutils.py b/cps/gdriveutils.py index 683605ff..a996f879 100644 --- a/cps/gdriveutils.py +++ b/cps/gdriveutils.py @@ -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']: diff --git a/cps/oauth_bb.py b/cps/oauth_bb.py index d98ec50a..3777d751 100644 --- a/cps/oauth_bb.py +++ b/cps/oauth_bb.py @@ -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']) diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index 6cb95764..2d1ae560 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -30,20 +30,20 @@