Skip to content

Commit 1efbb24

Browse files
authored
send sponsor_id when calling pycon create voucher api (#2722)
1 parent eaeb157 commit 1efbb24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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:

0 commit comments

Comments
 (0)