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
expandquery:This PR adds
expandqueries where necessary.Removed query
?questions=allPreviously, we used
?questions=allon the/submissionsandspeakers/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
/schedulecontained the keysslotsandbreaks:slotscontained all submission slots (talks, tutorials, ...) and contained objects of type "Submission"breakscontained all non-submission slots (lunch and coffee breaks) and contained objects of another typeslotwith the slot details (time, location).Previously, the responses to
/submissionscontained oneslotobject per submission (the first slot).In the new version,
/scheduleonly returnsslots. The response objects contain the slot details (time, location), and an optional reference to the submission.The responses to
/submissionsnow 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.avatartospeaker.avatar_urlThis PR updates the deserialization keyword, but keeps
avatarin the transformation result.