Fix bug get bookmarks
This commit is contained in:
parent
1ae8de894b
commit
861db768cd
|
|
@ -50,16 +50,17 @@ def find_content(content_list, bookmark):
|
||||||
if content['type'] in ['text_block', 'subtitle', 'solution']:
|
if content['type'] in ['text_block', 'subtitle', 'solution']:
|
||||||
return content['value'].get('text', '')
|
return content['value'].get('text', '')
|
||||||
if content['type'] in ['basic_knowledge']:
|
if content['type'] in ['basic_knowledge']:
|
||||||
description = content['value'].get('description', '')
|
if type(content['value']) is dict:
|
||||||
if not description:
|
description = content['value'].get('description', '')
|
||||||
try:
|
if not description:
|
||||||
return BasicKnowledge.objects.get(pk=content['value']['basic_knowledge']).title
|
try:
|
||||||
except BasicKnowledge.DoesNotExist:
|
return BasicKnowledge.objects.get(pk=content['value']['basic_knowledge']).title
|
||||||
return ''
|
except BasicKnowledge.DoesNotExist:
|
||||||
|
return ''
|
||||||
|
else:
|
||||||
|
return description
|
||||||
else:
|
else:
|
||||||
return description
|
logger.warn(f"Content value is not a dict: {content['value']}")
|
||||||
print(bookmark.uuid)
|
|
||||||
print(json.dumps(content_dict, indent=4))
|
|
||||||
return content_dict.get(content['type'], '')
|
return content_dict.get(content['type'], '')
|
||||||
|
|
||||||
class NoteNode(DjangoObjectType):
|
class NoteNode(DjangoObjectType):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue