From 67edd0d6b3cfc09d325c75cc66054852763d1f9c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 23 Mar 2021 15:49:01 +0100 Subject: Fix parcel sorting from a file --- archaeological_operations/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'archaeological_operations/forms.py') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index ce0e6d8be..12011ef28 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -311,7 +311,8 @@ class ParcelFormSet(FormSet): and not public_domain: Z = 'ZZZZZZZZZZZZZ' return (Z, Z, Z, Z, Z) - return (town, year, section, parcel_number, public_domain) + return (town.name if hasattr(town, "name") else None, year, section, + parcel_number, public_domain) def as_table(self): # add dynamic widget -- cgit v1.2.3