Migrate to new Pretalx API #133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Pretalx updated their API and it broke our setup.
This PR fixes it, the YouTube integration was not tested (my token cannot access
/p/youtube
, so I usedmake all EXCLUDE=youtube
)Fixes #132
Details
API Changes
Nested resources
In the old API, nested resources were always embedded in the parent response body:
In the new API, nested resources are only referenced by their IDs:
The old behavior can be restored with the
expand
query:This PR adds
expand
queries where necessary.Removed query
?questions=all
Previously, we used
?questions=all
on the/submissions
andspeakers/
endpoints. This is not supported anymore. Answers and questions are now handled like all other nested resources (see above).This PR removes these queries.
Schedule slots
Previously, the response to
/schedule
contained the keysslots
andbreaks
:slots
contained all submission slots (talks, tutorials, ...) and contained objects of type "Submission"breaks
contained all non-submission slots (lunch and coffee breaks) and contained objects of another typeslot
with the slot details (time, location).Previously, the responses to
/submissions
contained oneslot
object per submission (the first slot).In the new version,
/schedule
only returnsslots
. The response objects contain the slot details (time, location), and an optional reference to the submission.The responses to
/submissions
now containslots
(all slots) instead ofslot
(first slot).This PR uses pydantic's BeforeValidators to re-arrange the data to the old format before deserialization.
Changed structure of localized names
Before:
After:
This PR updates the deserialization logic for
submission.track
,submission.submission_type
, andslot.room
.Renamed
speaker.avatar
tospeaker.avatar_url
This PR updates the deserialization keyword, but keeps
avatar
in the transformation result.