Skip to content

Commit

Permalink
formatting tweaks to the renewal contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin committed Dec 19, 2023
1 parent 4ef4388 commit c00f46e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sponsors/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 2 additions & 0 deletions sponsors/tests/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit c00f46e

Please sign in to comment.