Skip to content

Commit 1d6df88

Browse files
authored
Merge branch 'main' into pymanager
2 parents 960b299 + 1efbb24 commit 1d6df88

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

sponsors/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def get(self, request, *args, **kwargs):
3434
for sponsorship in sponsorships.select_related("sponsor").iterator():
3535
sponsor = sponsorship.sponsor
3636
base_data = {
37+
"sponsor_id": sponsor.id,
3738
"sponsor": sponsor.name,
3839
"sponsor_slug": sponsor.slug,
3940
"level_name": sponsorship.level_name,

sponsors/management/commands/create_pycon_vouchers_for_sponsors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ def api_call(uri, query):
6666
scheme = "http" if settings.DEBUG else "https"
6767
url = f"{scheme}://{settings.PYCON_API_HOST}{uri}"
6868
try:
69-
return requests.get(url, headers=headers, params=query).json()
69+
r = requests.get(url, headers=headers, params=query)
70+
return r.json()
7071
except RequestException:
72+
print(r, r.content)
7173
raise
7274

7375

@@ -103,6 +105,7 @@ def generate_voucher_codes(year):
103105
"voucher_type": code["voucher_type"],
104106
"quantity": quantity.quantity,
105107
"sponsor_name": sponsorbenefit.sponsorship.sponsor.name,
108+
"sponsor_id": sponsorbenefit.sponsorship.sponsor.id,
106109
},
107110
)
108111
if result["code"] == 200:

sponsors/serializers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class LogoPlacementSerializer(serializers.Serializer):
88
publisher = serializers.CharField()
99
flight = serializers.CharField()
1010
sponsor = serializers.CharField()
11+
sponsor_id = serializers.CharField()
1112
sponsor_slug = serializers.CharField()
1213
description = serializers.CharField()
1314
logo = serializers.URLField()

0 commit comments

Comments
 (0)