From 9065becbac720b98e004bdefb7d236d69327c592 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 19 Jan 2021 12:04:05 +0100 Subject: Find form: fix insurance value filter --- archaeological_finds/forms.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'archaeological_finds') diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 014a094bc..4a93ffce4 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -897,12 +897,14 @@ class PreservationForm(CustomForm, ManageOldType): def __init__(self, *args, **kwargs): super(PreservationForm, self).__init__(*args, **kwargs) - self.fields['insurance_value'].label = u"{} ({})".format( - str(self.fields['insurance_value'].label), - get_current_profile().currency) - self.fields['estimated_value'].label = u"{} ({})".format( - str(self.fields['estimated_value'].label), - get_current_profile().currency) + if 'insurance_value' in self.fields: + self.fields['insurance_value'].label = "{} ({})".format( + str(self.fields['insurance_value'].label), + get_current_profile().currency) + if 'estimated_value' in self.fields: + self.fields['estimated_value'].label = "{} ({})".format( + str(self.fields['estimated_value'].label), + get_current_profile().currency) class DateForm(ManageOldType, forms.Form): -- cgit v1.2.3