Skip to content

Commit 742fd46

Browse files
committed
oops + notify the user about the transformation start and end
1 parent 49c3615 commit 742fd46

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/download.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
headers = {
1313
"Accept": "application/json, text/javascript",
14-
"Authorization": f"Token {Config.token}",
14+
"Authorization": f"Token {Config.token()}",
1515
}
1616

1717
base_url = f"https://pretalx.com/api/events/{Config.event}/"
@@ -35,6 +35,10 @@
3535
n += 1
3636
print(f"Page {n}")
3737
response = requests.get(url, headers=headers)
38+
39+
if response.status_code != 200:
40+
raise Exception(f"Error {response.status_code}: {response.text}")
41+
3842
data = response.json()
3943
res0 += data["results"]
4044

src/transform.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,7 @@ def save_publishable_speakers():
242242
)
243243

244244
if __name__ == "__main__":
245+
print("Saving publishable data...")
245246
save_publishable_sessions()
246247
save_publishable_speakers()
248+
print("Done")

0 commit comments

Comments
 (0)