From 0968c3f873082c3cad57e7a4b5dddae5d001c0eb Mon Sep 17 00:00:00 2001 From: Ishaan Mittal Date: Tue, 5 Dec 2023 03:10:37 +0530 Subject: [PATCH] left long rebate bug fixed --- home/utils/rebate_bills_saver.py | 2 +- home/utils/rebate_checker.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/home/utils/rebate_bills_saver.py b/home/utils/rebate_bills_saver.py index e730140..c21409f 100644 --- a/home/utils/rebate_bills_saver.py +++ b/home/utils/rebate_bills_saver.py @@ -59,7 +59,7 @@ def save_short_bill(student,period,days,high_tea,caterer): def save_long_bill(email,days_per_period,j): student = Student.objects.filter(email=email).last() for period,days in days_per_period: - if not isinstance(period, QuerySet): + if isinstance(period, Period): rebate = StudentBills.objects.get(email=student,semester=period.semester) allocation = Allocation.objects.get(email=student,period=period) catererBill = CatererBills.objects.get(caterer=allocation.caterer,semester=period.semester) diff --git a/home/utils/rebate_checker.py b/home/utils/rebate_checker.py index e236650..a36eb54 100644 --- a/home/utils/rebate_checker.py +++ b/home/utils/rebate_checker.py @@ -12,13 +12,13 @@ def is_not_duplicate(student,new_rebate_start,new_rebate_end): """Checks if these dates are already applied for rebate""" try: for short_rebate in Rebate.objects.filter(email=student).all(): - if (short_rebate.start_date-timedelta(days=2) < new_rebate_start new_rebate_start>long_rebate.start_date-timedelta(days=2)) or (long_rebate.start_date-timedelta(days=2) new_rebate_start>long_rebate.start_date-timedelta(days=2)) or (long_rebate.start_date-timedelta(days=2)