diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-03-31 16:44:32 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-04-01 10:58:30 +0200 |
| commit | eb4c143192a178db7cad4026bcfd1e3780b8b01d (patch) | |
| tree | 41b354e01c10cec82feb332bec693a108b3281bf | |
| parent | dd491a87a258929a2e322af1c3a367647a5e344e (diff) | |
| download | Ishtar-eb4c143192a178db7cad4026bcfd1e3780b8b01d.tar.bz2 Ishtar-eb4c143192a178db7cad4026bcfd1e3780b8b01d.zip | |
✨ views: sheet for qualified biographical notes (redirect to biographical note sheet)
| -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") ) |
