Skip to content

Commit

Permalink
Jira link builder now correctly handles absent NCNs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Dec 19, 2024
1 parent 5588264 commit 37a2e9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion judgments/utils/link_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def build_jira_create_link(document: Document, request: HttpRequest) -> str:
reverse("full-text-html", kwargs={"document_uri": document.uri}),
)

preferred_ncn = document.identifiers.preferred(type=NeutralCitationNumber)

description_string = "{editor_html_url}".format(
editor_html_url="""{html_url}
Expand All @@ -94,7 +96,7 @@ def build_jira_create_link(document: Document, request: HttpRequest) -> str:
{source_email_label}: {source_email}
{consignment_ref_label}: {consignment_ref}""".format(
html_url=editor_html_url,
preferred_ncn=document.identifiers.preferred(type=NeutralCitationNumber),
preferred_ncn=preferred_ncn.value if preferred_ncn else "None",
source_name_label="Submitter",
source_name=document.source_name,
source_email_label="Contact email",
Expand Down

0 comments on commit 37a2e9f

Please sign in to comment.