Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
0cc07362
Commit
0cc07362
authored
Aug 21, 2020
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #1573
parent
1535bdbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
gdriveutils.py
cps/gdriveutils.py
+6
-2
oauth_bb.py
cps/oauth_bb.py
+2
-2
config_edit.html
cps/templates/config_edit.html
+3
-3
No files found.
cps/gdriveutils.py
View file @
0cc07362
...
@@ -602,8 +602,12 @@ def get_error_text(client_secrets=None):
...
@@ -602,8 +602,12 @@ def get_error_text(client_secrets=None):
if
not
os
.
path
.
isfile
(
CLIENT_SECRETS
):
if
not
os
.
path
.
isfile
(
CLIENT_SECRETS
):
return
'client_secrets.json is missing or not readable'
return
'client_secrets.json is missing or not readable'
with
open
(
CLIENT_SECRETS
,
'r'
)
as
settings
:
try
:
filedata
=
json
.
load
(
settings
)
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
:
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'
]:
if
'redirect_uris'
not
in
filedata
[
'web'
]:
...
...
cps/oauth_bb.py
View file @
0cc07362
...
@@ -287,7 +287,7 @@ if ub.oauth_support:
...
@@ -287,7 +287,7 @@ if ub.oauth_support:
flash
(
_
(
u"Unlink to
%(oauth)
s Failed"
,
oauth
=
oauth_check
[
provider
]),
category
=
"error"
)
flash
(
_
(
u"Unlink to
%(oauth)
s Failed"
,
oauth
=
oauth_check
[
provider
]),
category
=
"error"
)
except
NoResultFound
:
except
NoResultFound
:
log
.
warning
(
"oauth
%
s for user
%
d not found"
,
provider
,
current_user
.
id
)
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'
))
return
redirect
(
url_for
(
'web.profile'
))
...
@@ -355,4 +355,4 @@ if ub.oauth_support:
...
@@ -355,4 +355,4 @@ if ub.oauth_support:
@
oauth
.
route
(
'/unlink/google'
,
methods
=
[
"GET"
])
@
oauth
.
route
(
'/unlink/google'
,
methods
=
[
"GET"
])
@
login_required
@
login_required
def
google_login_unlink
():
def
google_login_unlink
():
return
unlink_oauth
(
oauthblueprints
[
1
][
'
blueprint'
]
.
name
)
return
unlink_oauth
(
oauthblueprints
[
1
][
'
id'
]
)
cps/templates/config_edit.html
View file @
0cc07362
...
@@ -30,20 +30,20 @@
...
@@ -30,20 +30,20 @@
<div
data-related=
"gdrive_settings"
>
<div
data-related=
"gdrive_settings"
>
{% if gdriveError %}
{% if gdriveError %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
<label
id=
"gdrive_error"
>
{{_('Google Drive config problem')}}: {{ gdriveError }}
{{_('Google Drive config problem')}}: {{ gdriveError }}
</label>
</label>
</div>
</div>
{% else %}
{% else %}
{% if show_authenticate_google_drive and g.user.is_authenticated and config.config_use_google_drive %}
{% if show_authenticate_google_drive and g.user.is_authenticated and config.config_use_google_drive %}
<div
class=
"form-group required"
>
<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>
</div>
{% else %}
{% else %}
{% if show_authenticate_google_drive and g.user.is_authenticated and not config.config_use_google_drive %}
{% 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>
<div
>
{{_('Please hit save to continue with setup')}}
</div>
{% endif %}
{% 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>
<div
>
{{_('Please finish Google Drive setup after login')}}
</div>
{% endif %}
{% endif %}
{% if g.user.is_authenticated %}
{% if g.user.is_authenticated %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment