Skip to content

Commit

Permalink
fix left short rebate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Nov 19, 2024
1 parent 081553d commit e3aa828
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions home/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def export_as_csv(self, request, queryset):
"""
Export action available in the admin page
"""
resource = RebateBillsResource()
resource = StudentBillsResource()
dataset = resource.export(queryset)
response = HttpResponse(dataset.csv, content_type="text/csv")
response["Content-Disposition"] = 'attachment; filename="RebateAutumn.csv"'
Expand Down Expand Up @@ -1050,9 +1050,10 @@ def Add(self, request, queryset: list[LeftShortRebate]):
upper_cap_check = max_days_rebate(
student_obj, start_date, end_date, period
)
if upper_cap_check == 0:
continue
end_date = start_date + timedelta(days=upper_cap_check - 1)
if upper_cap_check > 0:
end_date = start_date + timedelta(
days=(upper_cap_check - 1)
)
short_rebate = Rebate(
email=student_obj,
allocation_id=allocation,
Expand Down

0 comments on commit e3aa828

Please sign in to comment.