Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiebelle committed Jan 7, 2024
1 parent 6b517a0 commit 3e0bdfe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sponsors/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,15 @@ def has_delete_permission(self, request, obj=None):
return True
return obj.open_for_editing

def get_queryset(self, *args, **kwargs):
def get_queryset(self, request):
qs = super().get_queryset(request)
match = request.resolver_match
sponsorship = self.parent_model.objects.get(pk=match.kwargs["object_id"])

sponsorship = self.parent_model.objects.get(pk=match.kwargs["object_id"])
year = sponsorship.year
# available_packages = SponsorshipPackage.objects.from_year(year)
qs = super().get_queryset(*args, **kwargs)
filtered = qs.filter(sponsorship_benefit__year=year)

return filtered.select_related("sponsorship_benefit__program", "program")
return filtered


class TargetableEmailBenefitsFilter(admin.SimpleListFilter):
Expand Down

0 comments on commit 3e0bdfe

Please sign in to comment.