From 95998ca3eb16005a92782a2ca07b4c47ed8d1c80 Mon Sep 17 00:00:00 2001 From: James Biggs Date: Thu, 14 Nov 2024 10:26:10 +0000 Subject: [PATCH 1/2] Update record serializing to handle None values --- etna/records/blocks.py | 12 +++++++----- etna/records/serializers.py | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/etna/records/blocks.py b/etna/records/blocks.py index 378a6f0d2..05bbae978 100644 --- a/etna/records/blocks.py +++ b/etna/records/blocks.py @@ -107,11 +107,13 @@ def extract_references(self, value): return [] def get_api_representation(self, value, context=None): - return { - "title": value.summary_title, - "iaid": value.iaid, - "reference_number": value.reference_number, - } + if value: + return { + "title": value.summary_title, + "iaid": value.iaid, + "reference_number": value.reference_number, + } + return None class Meta: icon = "archive" diff --git a/etna/records/serializers.py b/etna/records/serializers.py index 62841034d..af9be4e99 100644 --- a/etna/records/serializers.py +++ b/etna/records/serializers.py @@ -3,8 +3,10 @@ class RecordSerializer(serializers.Serializer): def to_representation(self, instance): - return { - "title": instance.summary_title, - "iaid": instance.iaid, - "reference_number": instance.reference_number, - } + if instance: + return { + "title": instance.summary_title, + "iaid": instance.iaid, + "reference_number": instance.reference_number, + } + return None From 2e72d731379cbfcce5ff6ce2b547f257a538e6c4 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Fri, 15 Nov 2024 13:03:19 +0000 Subject: [PATCH 2/2] Fix stories button path --- templates/collections/explorer_index_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/collections/explorer_index_page.html b/templates/collections/explorer_index_page.html index 697aee653..1ff1d4a5b 100644 --- a/templates/collections/explorer_index_page.html +++ b/templates/collections/explorer_index_page.html @@ -71,7 +71,7 @@

{{ page.articles_title }}