Skip to content

Commit

Permalink
Improve clarity of message for URI/NCN mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Nov 26, 2024
1 parent 260c8f6 commit 7c44fd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ <h3>
Document URI/NCN mismatch
</h3>
<p>
This document is located at <a href="{% url 'full-text-html' judgment.uri %}"><strong>/{{ judgment.uri }}</strong></a> but has an NCN of <a href="{{ corrected_ncn_url }}"><strong>{{ judgment.best_human_identifier }}</strong></a>
This document is currently located at <strong>/{{ judgment.uri }}</strong> but based on its NCN should be at <strong>/{{ corrected_ncn_url }}</strong>
</p>
<input type="hidden" name="judgment_uri" value="{{ document_uri }}" />
<div>
<input type="submit"
name="move_document"
value="Move to {{ corrected_ncn_url }}"
value="Move to /{{ corrected_ncn_url }}"
class="button-cta button-small" />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions judgments/tests/test_document_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def test_bad_ncn_has_banner(self, linked_document_uri, mock_judgment):
root = lxml.html.fromstring(response.content)
message = lxml.html.tostring(root.xpath("//div[@class='page-notification--warning']")[0])
assert b"Document URI/NCN mismatch" in message
assert b'This document is located at <a href="/uksc/1234/123">' in message
assert b'but has an NCN of <a href="/uksc/1234/999">' in message
assert b"This document is currently located at <strong>/uksc/1234/123</strong>" in message
assert b"but based on its NCN should be at <strong>/uksc/1234/999</strong>" in message
assert b'<input type="hidden" name="judgment_uri" value="uksc/1234/123">' in message

@patch("judgments.views.judgment_edit.api_client")
Expand Down

0 comments on commit 7c44fd5

Please sign in to comment.