From b31b23401318a62577ed060fece83cc7a43b68af Mon Sep 17 00:00:00 2001 From: robertavram Date: Tue, 28 Mar 2023 22:48:25 -0400 Subject: [PATCH] move closed interventions w amendments to active --- src/etools/applications/partners/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/etools/applications/partners/models.py b/src/etools/applications/partners/models.py index 48beaf8b5f..68945e4805 100644 --- a/src/etools/applications/partners/models.py +++ b/src/etools/applications/partners/models.py @@ -2864,6 +2864,11 @@ def merge_amendment(self): self.is_active = False self.save() + # TODO: Technical debt - remove after tempoorary exception for ended amendments is removed. + if self.intervention.status == self.intervention.ENDED: + if self.intervention.end >= datetime.date.today() >= self.intervention.start: + self.intervention.status = self.intervention.ACTIVE + self.intervention.save(amendment_number=self.intervention.amendments.filter(is_active=False).count()) amended_intervention.delete()