From e078af7d840b041fd3064711c65a25bcefada18a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 2 Jul 2019 10:59:54 +0200 Subject: Operation: fix parcel display where year is null (py3) --- archaeological_operations/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 95c60e6ff..aa4251273 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -2254,7 +2254,8 @@ class Parcel(LightHistorizedItem): @classmethod def grouped_parcels(cls, parcels): sortkeyfn = lambda s: (getattr(s, 'town_id'), - getattr(s, 'section'), getattr(s, 'year')) + getattr(s, 'section') or "", + getattr(s, 'year') or 0) parcels = sorted(parcels, key=sortkeyfn) grouped = [] for keys, parcel_grp in groupby(parcels, key=sortkeyfn): -- cgit v1.2.3