From e891b3d24a0bf85c762f845f1f5b0382568c46cb Mon Sep 17 00:00:00 2001 From: srivathsan Date: Sat, 4 May 2024 12:09:33 +0530 Subject: [PATCH 1/3] Chenged views.py on negative days calculation --- home/views.py | 4 +++- messWebsite/settings.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/home/views.py b/home/views.py index 0b47b3d..27eba57 100644 --- a/home/views.py +++ b/home/views.py @@ -282,7 +282,9 @@ def addLongRebateBill(request): if not is_not_duplicate(student, start_date, end_date): text = "You have already applied for rebate for these dates" elif before_rebate_days < 2: - text = "Your start date has to be 2 days from todays date" + text = "Your start date has to be 2 days from todays date" + elif days < 0: + text = "Your end date should be after your start date" else: # CHANGE THIS TO "FILE NOT UPLOADED". try: diff --git a/messWebsite/settings.py b/messWebsite/settings.py index a517ae3..8029a38 100644 --- a/messWebsite/settings.py +++ b/messWebsite/settings.py @@ -54,6 +54,7 @@ "django.middleware.clickjacking.XFrameOptionsMiddleware", "messWebsite.middleware.LoginRequiredMiddleware", 'whitenoise.middleware.WhiteNoiseMiddleware', + 'allauth.account.middleware.AccountMiddleware', ] ROOT_URLCONF = "messWebsite.urls" From 2a18146f62ef2bc06beea77759179c5ea68fe82a Mon Sep 17 00:00:00 2001 From: srivathsan Date: Sat, 4 May 2024 12:13:47 +0530 Subject: [PATCH 2/3] removed redundant space --- home/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/home/views.py b/home/views.py index 27eba57..3ab35d6 100644 --- a/home/views.py +++ b/home/views.py @@ -278,7 +278,6 @@ def addLongRebateBill(request): before_rebate_days = (start_date - date.today()).days days = (end_date - start_date).days + 1 student = Student.objects.get(email__iexact=request.user.email) - if not is_not_duplicate(student, start_date, end_date): text = "You have already applied for rebate for these dates" elif before_rebate_days < 2: From 6758a67340647741e9a13b556c81e6f3e133db38 Mon Sep 17 00:00:00 2001 From: srivathsan Date: Sat, 4 May 2024 12:40:21 +0530 Subject: [PATCH 3/3] Long rebate rejection options included --- home/models/students.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/home/models/students.py b/home/models/students.py index 3364e31..4d830ef 100644 --- a/home/models/students.py +++ b/home/models/students.py @@ -148,8 +148,10 @@ class LongRebate(models.Model): REASON_TYPE_CHOICES = ( ('', 'Choose the reason'), - ('Incomplete form', 'Incomplete form'), - ('There is a date mismatch between the one written in the form and the one in the attached form', 'There is a date mismatch between the one written in the form and the one in the attached form'), + ('Incomplete form. Please submit a new rebate application', 'Incomplete form'), + ('Signature of approving authority missing. Please submit a new rebate application', 'Signature missing'), + ('Attached file is not the rebate form. Please submit a new rebate application with correct attachment', 'Wrong attached document'), + ('There is a date mismatch between the one written in the form and the one in the attached form. Please submit a new rebate application', 'There is a date mismatch between the one written in the form and the one in the attached form'), )