🐛 handle plan details without section
This commit is contained in:
parent
f72e87f404
commit
27f39f6a1f
1 changed files with 7 additions and 2 deletions
|
|
@ -81,8 +81,13 @@ class GovPlanDetailView(GovernmentMixin, DetailView):
|
|||
def get_breadcrumbs(self, context):
|
||||
obj = context["object"]
|
||||
section = context["section"]
|
||||
return super().get_breadcrumbs(context) + [
|
||||
(section.title, section.get_absolute_url()),
|
||||
|
||||
breadcrumbs = super().get_breadcrumbs(context)
|
||||
|
||||
if section:
|
||||
breadcrumbs.append((section.title, section.get_absolute_url()))
|
||||
|
||||
return breadcrumbs + [
|
||||
(obj.title, obj.get_absolute_url()),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue