allow subslug pages as place page (#83742)

This commit is contained in:
Frédéric Péters 2023-11-21 09:20:27 +01:00
parent e7f732e5b0
commit 608a3b2404
1 changed files with 12 additions and 2 deletions

View File

@ -482,9 +482,19 @@ def place_page(cell):
fixed_place_cell = ConfigJsonCell.objects.get(
key=cell.key, parameters=cell.parameters, page__template_name='place'
)
return fixed_place_cell.page
except ConfigJsonCell.DoesNotExist:
return None
return fixed_place_cell.page
pass
dynamic_place_cell = (
ConfigJsonCell.objects.filter(key=cell.key, page__template_name='place')
.exclude(page__sub_slug='')
.first()
)
if dynamic_place_cell:
return dynamic_place_cell.page
return None
@register.filter