Fix bug get bookmarks

This commit is contained in:
Lorenz Padberg 2024-05-03 17:57:00 +02:00
parent 1ae8de894b
commit 861db768cd
1 changed files with 10 additions and 9 deletions

View File

@ -50,6 +50,7 @@ def find_content(content_list, bookmark):
if content['type'] in ['text_block', 'subtitle', 'solution']:
return content['value'].get('text', '')
if content['type'] in ['basic_knowledge']:
if type(content['value']) is dict:
description = content['value'].get('description', '')
if not description:
try:
@ -58,8 +59,8 @@ def find_content(content_list, bookmark):
return ''
else:
return description
print(bookmark.uuid)
print(json.dumps(content_dict, indent=4))
else:
logger.warn(f"Content value is not a dict: {content['value']}")
return content_dict.get(content['type'], '')
class NoteNode(DjangoObjectType):