Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page doesn't have category #68

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tipue_search/tipue_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ def create_json_node(self, page):
soup = BeautifulSoup(page.content, 'html.parser')
page_text = soup.get_text()

if getattr(page, 'category') == 'None':
try:
if getattr(page, 'category') == 'None':
page_category = ''
else:
page_category = page.category.name
except AttributeError:
page_category = ''
else:
page_category = page.category.name

page_url = self.siteurl + '/' + page.url

Expand Down