Skip to content

Commit 47f9024

Browse files
committed
fix urls
1 parent 8e7fac9 commit 47f9024

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

intbot/core/integrations/pretalx.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
logger = logging.getLogger(__name__)
99

1010
PRETALX_EVENTS = [
11-
"ep2023",
12-
"ep2024",
13-
"ep2025",
11+
"europython-2022",
12+
"europython-2023",
13+
"europython-2024",
14+
"europython-2025",
1415
]
1516

1617
ENDPOINTS = {
1718
# Questions need to be passed to include answers in the same endpoint,
1819
# saving us later time with joining the answers.
19-
PretalxData.PretalxResources.submissions: "submissions?questions=all",
20-
PretalxData.PretalxResources.speakers: "speakers?questions=all",
20+
PretalxData.PretalxResources.submissions: "submissions/?questions=all",
21+
PretalxData.PretalxResources.speakers: "speakers/?questions=all",
2122
}
2223

2324

@@ -54,6 +55,7 @@ def fetch_pretalx_data(event: str, resource: PretalxData.PretalxResources) -> li
5455
response = httpx.get(url, headers=headers)
5556

5657
if response.status_code != 200:
58+
breakpoint()
5759
raise Exception(f"Error {response.status_code}: {response.text}")
5860

5961
logger.info("Fetching data from %s, page %s", url, page)

intbot/tests/test_integrations/test_pretalx.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ def speaker_pages_generator(url):
6464

6565
@respx.mock
6666
def test_fetch_submissions_from_pretalx():
67-
url = "https://pretalx.com/api/events/ep2025/submissions?questions=all"
67+
url = "https://pretalx.com/api/events/europython-2025/submissions/?questions=all"
6868
data = submissions_pages_generator(url)
6969
respx.get(url).mock(return_value=next(data))
7070
respx.get(url + "&page=2").mock(return_value=next(data))
7171

7272
submissions = pretalx.fetch_pretalx_data(
73-
"ep2025",
73+
"europython-2025",
7474
PretalxData.PretalxResources.submissions,
7575
)
7676

@@ -82,13 +82,13 @@ def test_fetch_submissions_from_pretalx():
8282

8383
@respx.mock
8484
def test_fetch_speakers_from_pretalx():
85-
url = "https://pretalx.com/api/events/ep2025/speakers?questions=all"
85+
url = "https://pretalx.com/api/events/europython-2025/speakers/?questions=all"
8686
data = speaker_pages_generator(url)
8787
respx.get(url).mock(return_value=next(data))
8888
respx.get(url + "&page=2").mock(return_value=next(data))
8989

9090
submissions = pretalx.fetch_pretalx_data(
91-
"ep2025",
91+
"europython-2025",
9292
PretalxData.PretalxResources.speakers,
9393
)
9494

@@ -101,12 +101,12 @@ def test_fetch_speakers_from_pretalx():
101101
@respx.mock
102102
@pytest.mark.django_db
103103
def test_download_latest_submissions():
104-
url = "https://pretalx.com/api/events/ep2025/submissions?questions=all"
104+
url = "https://pretalx.com/api/events/europython-2025/submissions/?questions=all"
105105
data = submissions_pages_generator(url)
106106
respx.get(url).mock(return_value=next(data))
107107
respx.get(url + "&page=2").mock(return_value=next(data))
108108

109-
pretalx.download_latest_submissions("ep2025")
109+
pretalx.download_latest_submissions("europython-2025")
110110

111111
pd = PretalxData.objects.get(resource=PretalxData.PretalxResources.submissions)
112112
assert pd.resource == "submissions"
@@ -119,12 +119,12 @@ def test_download_latest_submissions():
119119
@respx.mock
120120
@pytest.mark.django_db
121121
def test_download_latest_speakers():
122-
url = "https://pretalx.com/api/events/ep2025/speakers?questions=all"
122+
url = "https://pretalx.com/api/events/europython-2025/speakers/?questions=all"
123123
data = speaker_pages_generator(url)
124124
respx.get(url).mock(return_value=next(data))
125125
respx.get(url + "&page=2").mock(return_value=next(data))
126126

127-
pretalx.download_latest_speakers("ep2025")
127+
pretalx.download_latest_speakers("europython-2025")
128128

129129
pd = PretalxData.objects.get(resource=PretalxData.PretalxResources.speakers)
130130
assert pd.resource == "speakers"

0 commit comments

Comments
 (0)