diff options
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index bd237488d..288a4f074 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -302,17 +302,14 @@ class ParcelFormSet(FormSet): parcel_number += str(int(p)) except ValueError: break - if not parcel_number: - parcel_number = 0 - else: - parcel_number = int(parcel_number) + parcel_number = int(parcel_number) if parcel_number else 0 # empty must be at the end if not year and not section and not parcel_number \ and not public_domain: - Z = 'ZZZZZZZZZZZZZ' - return (Z, Z, Z, Z, Z) - return (town.name if hasattr(town, "name") else None, year, section, - parcel_number, public_domain) + default = 'ZZZZZ' + return default, default, default, default, default + return (town.name if hasattr(town, "name") else "", year or '', section or "", + parcel_number or "", public_domain) def as_table(self): # add dynamic widget |