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'), ) diff --git a/home/views.py b/home/views.py index 0b47b3d..3ab35d6 100644 --- a/home/views.py +++ b/home/views.py @@ -278,11 +278,12 @@ 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: - 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"