We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f6fea6 commit a8d0a3fCopy full SHA for a8d0a3f
ui/ui.py
@@ -65,7 +65,8 @@ def get_page_by_id (page_id):
65
return g.db.pages.find_one( {'_id': page_id} )
66
67
def get_page_score (page_id):
68
- return len(g.db.pages.find_one({ '_id': page_id })['ref_pages'])
+ page = get_page_by_id(page_id)
69
+ return len(page['ref_pages']) if page and 'ref_pages' in page else 0
70
71
def intersect(a, b):
72
return list(set(a) & set(b))
0 commit comments