From 0f2f5681b47aed4ad399332472798d6837bd0ea5 Mon Sep 17 00:00:00 2001 From: Charles Prichard Date: Mon, 16 Oct 2023 15:48:30 +0100 Subject: [PATCH] tidy up --- .../jinja2/includes/commodities/tabs/core_data.jinja | 4 ++-- .../jinja2/includes/commodities/tabs/indent-history.jinja | 7 +++---- commodities/views.py | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/commodities/jinja2/includes/commodities/tabs/core_data.jinja b/commodities/jinja2/includes/commodities/tabs/core_data.jinja index 4ee05c490..06a957c05 100644 --- a/commodities/jinja2/includes/commodities/tabs/core_data.jinja +++ b/commodities/jinja2/includes/commodities/tabs/core_data.jinja @@ -26,12 +26,12 @@ }, { "key": {"text": "Indent number"}, - "value": {"text": indent_number if indent_start_date else "-"}, + "value": {"text": indent_number}, "actions": {"items": []} }, { "key": {"text": "Indent SID"}, - "value": {"text": indent_sid if indent_start_date else "-"}, + "value": {"text": indent_sid}, "actions": {"items": []} }, { diff --git a/commodities/jinja2/includes/commodities/tabs/indent-history.jinja b/commodities/jinja2/includes/commodities/tabs/indent-history.jinja index 594a6fad4..dd7c820d5 100644 --- a/commodities/jinja2/includes/commodities/tabs/indent-history.jinja +++ b/commodities/jinja2/includes/commodities/tabs/indent-history.jinja @@ -11,9 +11,9 @@ {% for i in indents %} {% set indent_row = [ - {"text": i.sid if indent_start_date else "-"}, - {"text": i.indent if indent_start_date else "-"}, - {"text": "{:%d %b %Y}".format(i.validity_start) if indent_start_date else "-"}, + {"text": i.sid if i.sid else "-"}, + {"text": i.indent if i.indent else "-"}, + {"text": "{:%d %b %Y}".format(i.validity_start) if i.validity_start else "-"}, ]%} {{ indent_rows.append(indent_row) or "" }} @@ -24,7 +24,6 @@ {"text": "Indent number", "classes": "govuk-!-width-one-eighth"}, {"text": "Indent start date", "classes": "govuk-!-width-one-eighth"}, ]%} - {# valid_between.lower (start) valid_between.upper (end) #}

Indent history

diff --git a/commodities/views.py b/commodities/views.py index 6ebfda819..9ff5e7942 100644 --- a/commodities/views.py +++ b/commodities/views.py @@ -95,9 +95,9 @@ def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) indent = self.object.get_indent_as_at(date.today()) + context["indent_number"] = indent.indent if indent else "-" + context["indent_sid"] = indent.sid if indent else "-" if indent: - context["indent_number"] = indent.indent - context["indent_sid"] = indent.sid context["indent_start_date"] = indent.validity_start collection = get_chapter_collection(self.object)