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
8af178c1
Commit
8af178c1
authored
Nov 26, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for gdrive not working #1081
parent
78f9ee86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
admin.py
cps/admin.py
+4
-1
gdriveutils.py
cps/gdriveutils.py
+2
-0
worker.py
cps/worker.py
+1
-1
No files found.
cps/admin.py
View file @
8af178c1
...
@@ -272,6 +272,8 @@ def _configuration_update_helper():
...
@@ -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,7 +415,8 @@ def _configuration_result(error_flash=None, gdriveError=None):
...
@@ -413,7 +415,8 @@ def _configuration_result(error_flash=None, gdriveError=None):
if
gdriveError
:
if
gdriveError
:
gdriveError
=
_
(
gdriveError
)
gdriveError
=
_
(
gdriveError
)
else
:
else
:
gdrivefolders
=
gdriveutils
.
listRootFolders
()
if
config
.
config_use_google_drive
and
not
gdrive_authenticate
:
gdrivefolders
=
gdriveutils
.
listRootFolders
()
show_back_button
=
current_user
.
is_authenticated
show_back_button
=
current_user
.
is_authenticated
show_login_button
=
config
.
db_configured
and
not
current_user
.
is_authenticated
show_login_button
=
config
.
db_configured
and
not
current_user
.
is_authenticated
...
...
cps/gdriveutils.py
View file @
8af178c1
...
@@ -584,5 +584,7 @@ def get_error_text(client_secrets=None):
...
@@ -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'
])
cps/worker.py
View file @
8af178c1
...
@@ -213,7 +213,7 @@ class WorkerThread(threading.Thread):
...
@@ -213,7 +213,7 @@ class WorkerThread(threading.Thread):
else
:
else
:
self
.
doLock
.
release
()
self
.
doLock
.
release
()
except
Exception
as
e
:
except
Exception
as
e
:
log
.
exception
(
e
)
log
.
exception
(
e
)
self
.
doLock
.
release
()
self
.
doLock
.
release
()
if
main_thread
.
is_alive
():
if
main_thread
.
is_alive
():
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
...
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