Skip to content

Commit

Permalink
update pycon sponsorship integration for 2025 (#2682)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin authored Jan 8, 2025
1 parent 023121f commit 9bd3afe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions sponsors/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def get(self, request, *args, **kwargs):
logo_filters.is_valid(raise_exception=True)

sponsorships = Sponsorship.objects.enabled().with_logo_placement()
if logo_filters.by_year:
sponsorships = sponsorships.filter(year=logo_filters.by_year)
for sponsorship in sponsorships.select_related("sponsor").iterator():
sponsor = sponsorship.sponsor
base_data = {
Expand Down
24 changes: 12 additions & 12 deletions sponsors/management/commands/create_pycon_vouchers_for_sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
)

BENEFITS = {
183: {
"internal_name": "full_conference_passes_code_2024",
241: {
"internal_name": "full_conference_passes_code_2025",
"voucher_type": "SPNS_COMP_",
},
201: {
"internal_name": "expo_hall_only_passes_code_2024",
259: {
"internal_name": "pycon_expo_hall_only_passes_code_2025",
"voucher_type": "SPNS_EXPO_COMP_",
},
208: {
"internal_name": "additional_full_conference_passes_code_2024",
265: {
"internal_name": "pycon_additional_full_conference_passes_code_2025",
"voucher_type": "SPNS_ADDL_DISC_REG_",
},
225: {
"internal_name": "online_only_conference_passes_2024",
"voucher_type": "SPNS_ONLINE_COMP_",
},
237: {
"internal_name": "additional_expo_hall_only_passes_2024",
#225: {
# "internal_name": "online_only_conference_passes_2025",
# "voucher_type": "SPNS_ONLINE_COMP_",
#},
292: {
"internal_name": "pycon_additional_expo_hall_only_passes_2025",
"voucher_type": "SPNS_EXPO_DISC_",
},
}
Expand Down
5 changes: 5 additions & 0 deletions sponsors/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class FilterLogoPlacementsSerializer(serializers.Serializer):
choices=[(c.value, c.name.replace("_", " ").title()) for c in LogoPlacementChoices],
required=False,
)
year = serializers.IntegerField(required=False)

@property
def by_publisher(self):
Expand All @@ -67,6 +68,10 @@ def by_publisher(self):
def by_flight(self):
return self.validated_data.get("flight")

@property
def by_year(self):
return self.validated_data.get("year")

def skip_logo(self, logo):
if self.by_publisher and self.by_publisher != logo.publisher:
return True
Expand Down

0 comments on commit 9bd3afe

Please sign in to comment.