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
16199e96
Unverified
Commit
16199e96
authored
Aug 28, 2023
by
Jyong
Committed by
GitHub
Aug 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix notion import limit check (#1042)
Co-authored-by:
jyong
<
jyong@dify.ai
>
parent
02452421
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
dataset_service.py
api/services/dataset_service.py
+6
-4
No files found.
api/services/dataset_service.py
View file @
16199e96
...
@@ -402,8 +402,9 @@ class DocumentService:
...
@@ -402,8 +402,9 @@ class DocumentService:
upload_file_list
=
document_data
[
"data_source"
][
"info_list"
][
'file_info_list'
][
'file_ids'
]
upload_file_list
=
document_data
[
"data_source"
][
"info_list"
][
'file_info_list'
][
'file_ids'
]
count
=
len
(
upload_file_list
)
count
=
len
(
upload_file_list
)
elif
document_data
[
"data_source"
][
"type"
]
==
"notion_import"
:
elif
document_data
[
"data_source"
][
"type"
]
==
"notion_import"
:
notion_page_list
=
document_data
[
"data_source"
][
'info_list'
][
'notion_info_list'
][
'pages'
]
notion_info_list
=
document_data
[
"data_source"
][
'info_list'
][
'notion_info_list'
]
count
=
len
(
notion_page_list
)
for
notion_info
in
notion_info_list
:
count
=
count
+
len
(
notion_info
[
'pages'
])
documents_count
=
DocumentService
.
get_tenant_documents_count
()
documents_count
=
DocumentService
.
get_tenant_documents_count
()
total_count
=
documents_count
+
count
total_count
=
documents_count
+
count
tenant_document_count
=
int
(
current_app
.
config
[
'TENANT_DOCUMENT_COUNT'
])
tenant_document_count
=
int
(
current_app
.
config
[
'TENANT_DOCUMENT_COUNT'
])
...
@@ -663,8 +664,9 @@ class DocumentService:
...
@@ -663,8 +664,9 @@ class DocumentService:
upload_file_list
=
document_data
[
"data_source"
][
"info_list"
][
'file_info_list'
][
'file_ids'
]
upload_file_list
=
document_data
[
"data_source"
][
"info_list"
][
'file_info_list'
][
'file_ids'
]
count
=
len
(
upload_file_list
)
count
=
len
(
upload_file_list
)
elif
document_data
[
"data_source"
][
"type"
]
==
"notion_import"
:
elif
document_data
[
"data_source"
][
"type"
]
==
"notion_import"
:
notion_page_list
=
document_data
[
"data_source"
][
'info_list'
][
'notion_info_list'
][
'pages'
]
notion_info_list
=
document_data
[
"data_source"
][
'info_list'
][
'notion_info_list'
]
count
=
len
(
notion_page_list
)
for
notion_info
in
notion_info_list
:
count
=
count
+
len
(
notion_info
[
'pages'
])
# check document limit
# check document limit
if
current_app
.
config
[
'EDITION'
]
==
'CLOUD'
:
if
current_app
.
config
[
'EDITION'
]
==
'CLOUD'
:
documents_count
=
DocumentService
.
get_tenant_documents_count
()
documents_count
=
DocumentService
.
get_tenant_documents_count
()
...
...
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