From 70c88440aa1c9893c5c67379661cca5ae39485e5 Mon Sep 17 00:00:00 2001 From: Oliver Zander Date: Mon, 18 Aug 2025 12:53:40 +0200 Subject: [PATCH] fixed and improved quarter calculation --- input/models.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/input/models.py b/input/models.py index 4803db7..90b7384 100755 --- a/input/models.py +++ b/input/models.py @@ -154,16 +154,8 @@ class Project(Volunteer): # self.pid = str(self.account.code) + str(self.pk).zfill(3) print (("Hallo Leute! Ich save jetzt mal MIT PID DANN!!!",self.pid)) - - # generation of field quartals - if self.end.month in [1, 2, 3]: - self.end_quartal = 'Q1' - if self.end.month in [4, 5, 6]: - self.end_quartal = 'Q2' - if self.end.month in [7, 8, 9]: - self.end_quartal = 'Q3' - if self.end.month in [10, 11, 12]: - self.end_quartal = 'Q4' + if self.end: + self.end_quartal = f'Q{self.end.month // 4 + 1}' super().save()