Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
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
ai-tech
dify
Commits
fefa3482
Commit
fefa3482
authored
Jun 15, 2023
by
jyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sync source info update
parent
58d769b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
app.py
api/app.py
+1
-1
oauth_data_source.py
api/libs/oauth_data_source.py
+8
-4
No files found.
api/app.py
View file @
fefa3482
...
@@ -18,7 +18,7 @@ from extensions.ext_database import db
...
@@ -18,7 +18,7 @@ from extensions.ext_database import db
from
extensions.ext_login
import
login_manager
from
extensions.ext_login
import
login_manager
# DO NOT REMOVE BELOW
# DO NOT REMOVE BELOW
from
models
import
model
,
account
,
dataset
,
web
,
task
from
models
import
model
,
account
,
dataset
,
web
,
task
,
source
from
events
import
event_handlers
from
events
import
event_handlers
# DO NOT REMOVE ABOVE
# DO NOT REMOVE ABOVE
...
...
api/libs/oauth_data_source.py
View file @
fefa3482
...
@@ -99,11 +99,15 @@ class NotionOAuth(OAuthDataSource):
...
@@ -99,11 +99,15 @@ class NotionOAuth(OAuthDataSource):
# get all authorized pages
# get all authorized pages
pages
=
self
.
get_authorized_pages
(
data_source_binding
.
access_token
)
pages
=
self
.
get_authorized_pages
(
data_source_binding
.
access_token
)
source_info
=
data_source_binding
.
source_info
source_info
=
data_source_binding
.
source_info
source_info
[
'pages'
]
=
pages
new_source_info
=
{
source_info
[
'total'
]
=
len
(
pages
)
'workspace_name'
:
source_info
[
'workspace_name'
],
data_source_binding
.
source_info
=
source_info
'workspace_icon'
:
source_info
[
'workspace_icon'
],
'workspace_id'
:
source_info
[
'workspace_id'
],
'pages'
:
pages
,
'total'
:
len
(
pages
)
}
data_source_binding
.
source_info
=
new_source_info
data_source_binding
.
disabled
=
False
data_source_binding
.
disabled
=
False
db
.
session
.
add
(
data_source_binding
)
db
.
session
.
commit
()
db
.
session
.
commit
()
else
:
else
:
raise
ValueError
(
'Data source binding not found'
)
raise
ValueError
(
'Data source binding not found'
)
...
...
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