Skip to content

Commit e3aa828

Browse files
committed
fix left short rebate bug
1 parent 081553d commit e3aa828

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

home/admin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def export_as_csv(self, request, queryset):
790790
"""
791791
Export action available in the admin page
792792
"""
793-
resource = RebateBillsResource()
793+
resource = StudentBillsResource()
794794
dataset = resource.export(queryset)
795795
response = HttpResponse(dataset.csv, content_type="text/csv")
796796
response["Content-Disposition"] = 'attachment; filename="RebateAutumn.csv"'
@@ -1050,9 +1050,10 @@ def Add(self, request, queryset: list[LeftShortRebate]):
10501050
upper_cap_check = max_days_rebate(
10511051
student_obj, start_date, end_date, period
10521052
)
1053-
if upper_cap_check == 0:
1054-
continue
1055-
end_date = start_date + timedelta(days=upper_cap_check - 1)
1053+
if upper_cap_check > 0:
1054+
end_date = start_date + timedelta(
1055+
days=(upper_cap_check - 1)
1056+
)
10561057
short_rebate = Rebate(
10571058
email=student_obj,
10581059
allocation_id=allocation,

0 commit comments

Comments
 (0)