From 2594c7a54847a62d8f3209d5213af9d84923fc39 Mon Sep 17 00:00:00 2001 From: chris48s Date: Wed, 30 Oct 2024 15:52:20 +0000 Subject: [PATCH] define weight in terms of parent --- postcode_lookup/template_sorter.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/postcode_lookup/template_sorter.py b/postcode_lookup/template_sorter.py index eb08cc6..28d7235 100644 --- a/postcode_lookup/template_sorter.py +++ b/postcode_lookup/template_sorter.py @@ -177,12 +177,8 @@ def __init__(self, *args, **kwargs) -> None: @property def weight(self): - if self.timetable.is_before(TimetableEvent.REGISTRATION_DEADLINE): - return -5999 - - if self.timetable.is_after(TimetableEvent.REGISTRATION_DEADLINE): - return 1002 - return 0 + parent_weight = super().weight + return 0 if parent_weight == 0 else parent_weight + 1 @property def context(self):