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
9cc14ac5
Commit
9cc14ac5
authored
Apr 18, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #1905 prevent invalid json data in gmail_token
parent
c0a4addf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
config_sql.py
cps/config_sql.py
+4
-2
gmail.py
cps/services/gmail.py
+1
-0
No files found.
cps/config_sql.py
View file @
9cc14ac5
...
...
@@ -20,6 +20,7 @@
from
__future__
import
division
,
print_function
,
unicode_literals
import
os
import
sys
import
json
from
sqlalchemy
import
Column
,
String
,
Integer
,
SmallInteger
,
Boolean
,
BLOB
,
JSON
from
sqlalchemy.exc
import
OperationalError
...
...
@@ -261,7 +262,6 @@ class _ConfigSQL(object):
"""
new_value
=
dictionary
.
get
(
field
,
default
)
if
new_value
is
None
:
# log.debug("_ConfigSQL set_from_dictionary field '%s' not found", field)
return
False
if
field
not
in
self
.
__dict__
:
...
...
@@ -278,7 +278,6 @@ class _ConfigSQL(object):
if
current_value
==
new_value
:
return
False
# log.debug("_ConfigSQL set_from_dictionary '%s' = %r (was %r)", field, new_value, current_value)
setattr
(
self
,
field
,
new_value
)
return
True
...
...
@@ -383,6 +382,9 @@ def _migrate_table(session, orm_class):
log
.
debug
(
alter_table
)
session
.
execute
(
alter_table
)
changed
=
True
except
json
.
decoder
.
JSONDecodeError
as
e
:
log
.
error
(
"Database corrupt column: {}"
.
format
(
column_name
))
log
.
debug
(
e
)
if
changed
:
try
:
...
...
cps/services/gmail.py
View file @
9cc14ac5
...
...
@@ -53,6 +53,7 @@ def setup_gmail(token):
'expiry'
:
creds
.
expiry
.
isoformat
(),
'email'
:
user_info
}
return
{}
def
get_user_info
(
credentials
):
user_info_service
=
build
(
serviceName
=
'oauth2'
,
version
=
'v2'
,
credentials
=
credentials
)
...
...
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