From c00f46eee7d64f3a4d4a443bb6754c5047a02d4b Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Tue, 19 Dec 2023 14:49:42 -0500 Subject: [PATCH] formatting tweaks to the renewal contract --- sponsors/pdf.py | 4 +++- sponsors/tests/test_pdf.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sponsors/pdf.py b/sponsors/pdf.py index f1b80d911..9855beee3 100644 --- a/sponsors/pdf.py +++ b/sponsors/pdf.py @@ -34,7 +34,9 @@ def _contract_context(contract, **context): "legal_clauses": _clean_split(contract.legal_clauses.raw), "renewal": contract.sponsorship.renewal, }) - context["previous_effective"] = contract.sponsorship.previous_effective_date if contract.sponsorship.previous_effective_date else "UNKNOWN" + previous_effective = contract.sponsorship.previous_effective_date + context["previous_effective"] = previous_effective if previous_effective else "UNKNOWN" + context["previous_effective_english_suffix"] = format(previous_effective, "S") if previous_effective else None return context diff --git a/sponsors/tests/test_pdf.py b/sponsors/tests/test_pdf.py index 2116b7c21..e4d140cf2 100644 --- a/sponsors/tests/test_pdf.py +++ b/sponsors/tests/test_pdf.py @@ -30,6 +30,7 @@ def setUp(self): "legal_clauses": [], "renewal": None, "previous_effective": "UNKNOWN", + "previous_effective_english_suffix": None, } self.template = "sponsors/admin/preview-contract.html" @@ -90,6 +91,7 @@ def test_render_response_with_docx_attachment__renewal(self, MockDocxTemplate): "legal_clauses": [], "renewal": True, "previous_effective": "UNKNOWN", + "previous_effective_english_suffix": None, } renewal_template = "sponsors/admin/preview-contract.html"