Skip to content

Commit

Permalink
fix(templatetags): assumed menu item redirect_url
Browse files Browse the repository at this point in the history
Do not assume a menu item has the attribute redirect_url.

This assumption caused template crash on loading news article that has category assigned.
  • Loading branch information
wesleyboar authored Apr 1, 2022
1 parent 69667ca commit 81a01c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taccsite_cms/templatetags/tacc_uri_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_menu_uri(menu_item):
{{ child.get_menu_title }}</a>
# <a href="https://otherwebsite.com/some-page">some page there</a>
"""
if menu_item.attr['redirect_url']:
if hasattr(menu_item.attr, 'book_name'):
return menu_item.attr['redirect_url']
else:
return menu_item.get_absolute_url()

0 comments on commit 81a01c1

Please sign in to comment.