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
5470acd3
Commit
5470acd3
authored
May 01, 2021
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1964 (RefreshError with unconfigured gdrive)
parent
64696fe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
admin.py
cps/admin.py
+4
-3
gdriveutils.py
cps/gdriveutils.py
+1
-1
No files found.
cps/admin.py
View file @
5470acd3
...
...
@@ -38,7 +38,6 @@ from sqlalchemy import and_
from
sqlalchemy.orm.attributes
import
flag_modified
from
sqlalchemy.exc
import
IntegrityError
,
OperationalError
,
InvalidRequestError
from
sqlalchemy.sql.expression
import
func
,
or_
,
text
# from sqlalchemy.func import field
from
.
import
constants
,
logger
,
helper
,
services
from
.cli
import
filepicker
...
...
@@ -977,7 +976,10 @@ def _configuration_gdrive_helper(to_save):
)
# always show google drive settings, but in case of error deny support
config
.
config_use_google_drive
=
(
not
gdrive_error
)
and
(
"config_use_google_drive"
in
to_save
)
new_gdrive_value
=
(
not
gdrive_error
)
and
(
"config_use_google_drive"
in
to_save
)
if
config
.
config_use_google_drive
and
not
new_gdrive_value
:
config
.
config_google_drive_watch_changes_response
=
{}
config
.
config_use_google_drive
=
new_gdrive_value
if
_config_string
(
to_save
,
"config_google_drive_folder"
):
gdriveutils
.
deleteDatabaseOnChange
()
return
gdrive_error
...
...
@@ -1230,7 +1232,6 @@ def _configuration_result(error_flash=None, gdrive_error=None, configured=True):
log
.
error
(
gdrive_error
)
gdrive_error
=
_
(
gdrive_error
)
else
:
# if config.config_use_google_drive and\
if
not
gdrive_authenticate
and
gdrive_support
:
gdrivefolders
=
gdriveutils
.
listRootFolders
()
...
...
cps/gdriveutils.py
View file @
5470acd3
...
...
@@ -221,7 +221,7 @@ def listRootFolders():
drive
=
getDrive
(
Gdrive
.
Instance
()
.
drive
)
folder
=
"'root' in parents and mimeType = 'application/vnd.google-apps.folder' and trashed = false"
fileList
=
drive
.
ListFile
({
'q'
:
folder
})
.
GetList
()
except
(
ServerNotFoundError
,
ssl
.
SSLError
)
as
e
:
except
(
ServerNotFoundError
,
ssl
.
SSLError
,
RefreshError
)
as
e
:
log
.
info
(
"GDrive Error
%
s"
%
e
)
fileList
=
[]
return
fileList
...
...
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