diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-01-19 12:04:05 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:23 +0100 |
commit | 13b56aa38586bb1c8e9efee180c88606ee225c4c (patch) | |
tree | 1ea54e0f5a243e1c7e56c8be2b8a4586099811dc /archaeological_finds/forms.py | |
parent | 33d3564a96442046384fa2cc1feaceb3bb142d33 (diff) | |
download | Ishtar-13b56aa38586bb1c8e9efee180c88606ee225c4c.tar.bz2 Ishtar-13b56aa38586bb1c8e9efee180c88606ee225c4c.zip |
Find form: fix insurance value filter
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 14 |
1 files changed, 8 insertions, 6 deletions
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): |