Skip to content

Commit

Permalink
filtering by current_year where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin committed Dec 14, 2023
1 parent 1296660 commit fad5f2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sponsors/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class TargetableEmailBenefitsFilter(admin.SimpleListFilter):
@cached_property
def benefits(self):
qs = EmailTargetableConfiguration.objects.all().values_list("benefit_id", flat=True)
benefits = SponsorshipBenefit.objects.filter(id__in=Subquery(qs))
benefits = SponsorshipBenefit.objects.filter(id__in=Subquery(qs), year=SponsorshipCurrentYear.get_year())
return {str(b.id): b for b in benefits}

def lookups(self, request, model_admin):
Expand Down
1 change: 1 addition & 0 deletions sponsors/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def get_package(self):
if not pkg_benefits and standalone: # standalone only
pkg, _ = SponsorshipPackage.objects.get_or_create(
slug="standalone-only",
year=SponsorshipCurrentYear.get_year(),
defaults={"name": "Standalone Only", "sponsorship_amount": 0},
)

Expand Down

0 comments on commit fad5f2b

Please sign in to comment.