Skip to content

Commit 24030d1

Browse files
committed
🐛 catch AttributeError when navigation_node is str
1 parent 6598183 commit 24030d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fragdenstaat_de/fds_cms/templatetags/fds_cms_tags.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,23 @@ def get_soft_root(page):
8282
@register.simple_tag(takes_context=True)
8383
def get_breadcrumb_ancestor(context, navigation_node):
8484
print(context)
85-
if navigation_node == None:
85+
if navigation_node is None:
8686
return
8787

8888
try:
8989
request = context["request"]
9090
except KeyError:
9191
return
9292

93-
page = Page.objects.get(pk=navigation_node.id)
9493

9594
try:
95+
page = Page.objects.get(pk=navigation_node.id)
9696
ancestor = page.fdspageextension.breadcrumb_ancestor
9797
only_upwards = page.fdspageextension.ancestor_only_upwards
9898
except AttributeError:
9999
return
100100

101-
if ancestor == None:
101+
if ancestor is None:
102102
return
103103

104104
if only_upwards and request.current_page != page:

0 commit comments

Comments
 (0)