diff --git a/shared/models/main.py b/shared/models/main.py index ac8e9e914c0409c1b476790b9e4d5dd45ca1560c..42e7f2e68aba357998b4f5e5bd8dd66d5e220db7 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -261,7 +261,15 @@ class PageInMenuMixin(Page): return menu.value["title"] elif menu.block_type == "menu_parent": for item in menu.value["menu_items"]: - if item["link"].strip() == instance.full_url.strip(): + if ( + item["link"].strip() + if item["link"] is not None + else "" + ) == ( + instance.full_url.strip() + if instance.full_url + else "" + ): return menu.value["title"] if item["page"] is None: diff --git a/uniweb/templates/uniweb/blocks/people_group_block.html b/uniweb/templates/uniweb/blocks/people_group_block.html index d268139f0cf98e0b9c5a64632595c359f624e3e0..b75071db202105ef40340d106cd5df99ce932c66 100644 --- a/uniweb/templates/uniweb/blocks/people_group_block.html +++ b/uniweb/templates/uniweb/blocks/people_group_block.html @@ -5,7 +5,11 @@ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> {% for person_details in self.person_list %} {% with person_details.person as person_page %} - {% include "shared/person_badge_snippet.html" with title=person_details.position|default:person_page.job %} + {% if person_details.position %} + {% include "shared/person_badge_snippet.html" with title=person_details.position %} + {% else %} + {% include "shared/person_badge_snippet.html" with title=person_page.job %} + {% endif %} {% endwith %} {% endfor %} </div>