mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-01 10:48:37 +08:00
fix: fetch page name of notion wiki (#3847)
This commit is contained in:
parent
2a8881d0e8
commit
4d66a86579
@ -153,23 +153,12 @@ class NotionOAuth(OAuthDataSource):
|
||||
# get page detail
|
||||
for page_result in page_results:
|
||||
page_id = page_result['id']
|
||||
if 'Name' in page_result['properties']:
|
||||
if len(page_result['properties']['Name']['title']) > 0:
|
||||
page_name = page_result['properties']['Name']['title'][0]['plain_text']
|
||||
else:
|
||||
page_name = 'Untitled'
|
||||
elif 'title' in page_result['properties']:
|
||||
if len(page_result['properties']['title']['title']) > 0:
|
||||
page_name = page_result['properties']['title']['title'][0]['plain_text']
|
||||
else:
|
||||
page_name = 'Untitled'
|
||||
elif 'Title' in page_result['properties']:
|
||||
if len(page_result['properties']['Title']['title']) > 0:
|
||||
page_name = page_result['properties']['Title']['title'][0]['plain_text']
|
||||
else:
|
||||
page_name = 'Untitled'
|
||||
else:
|
||||
page_name = 'Untitled'
|
||||
page_name = 'Untitled'
|
||||
for key in ['Name', 'title', 'Title', 'Page']:
|
||||
if key in page_result['properties']:
|
||||
if len(page_result['properties'][key].get('title', [])) > 0:
|
||||
page_name = page_result['properties'][key]['title'][0]['plain_text']
|
||||
break
|
||||
page_icon = page_result['icon']
|
||||
if page_icon:
|
||||
icon_type = page_icon['type']
|
||||
|
Loading…
Reference in New Issue
Block a user