diff options
| -rw-r--r-- | ishtar_common/urls.py | 5 | ||||
| -rw-r--r-- | ishtar_common/views.py | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py index 78b185ac7..66fe1ae36 100644 --- a/ishtar_common/urls.py +++ b/ishtar_common/urls.py @@ -522,6 +522,11 @@ urlpatterns += [ name="show-biographicalnote", ), re_path( + r"show-qualifiedbiographicalnote(?:/(?P<pk>.+))?/(?P<type>.+)?$", + views.show_qualified_biographical_note, + name="show-qualifiedbiographicalnote", + ), + re_path( r"new-biographicalnote/(?:(?P<parent_name>[^/]+)/)?(?:(?P<limits>[^/]+)/)?$", views.new_biographical_note, name="new-biographicalnote", diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 4e8376dfc..9ffd4a4eb 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1239,6 +1239,16 @@ get_person = get_item(models.Person, "get_person", "person", show_ishtaruser = show_item(models.IshtarUser, "ishtaruser", callback=get_ishtaruser_gdpr_log) show_biographical_note = show_item(models.BiographicalNote, "biographicalnote") + + +def show_qualified_biographical_note(request, pk, **dct): + q = models.QualifiedBiographicalNote.objects.filter(pk=pk) + if not q.exists(): + return Http404() + bio_pk = q.values("biographical_note_id").all()[0]["biographical_note_id"] + return show_item(models.BiographicalNote, "biographicalnote")(request, bio_pk, **dct) + + new_biographical_note = new_qa_item( models.BiographicalNote, forms.BiographicalNoteForm, page_name=_("New biographical note") ) |
