-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove instructor info serializer validation #34802
Merged
rayzhou-bit
merged 7 commits into
master
from
2u/remove-course-details-page-instructor-info-serializer-validation
May 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5d17e6e
fix: remove instructor info serializer validation
rayzhou-bit 10dc9c4
fix: allow_empty and allow_null on instructor info
rayzhou-bit 4dec4bf
fix: remove allow_null instructor info
rayzhou-bit 4e23d8a
fix: allow_blank
rayzhou-bit b28ebbb
fix: allow_null
rayzhou-bit 058ae2c
fix: move allow_empty etc to child
rayzhou-bit 948f08a
fix: remove allow_blank
rayzhou-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it makes sense to keep the serializer validation so that only the expected information comes through when it is present. I agree with allowing the serializer to be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I'm seeing with this is in the case when
instructor_info
isn't empty, we're not necessarily getting theinstructors
field.I've seen the following, so I think it's possible to get
instructors
in other languages too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MFE version of the schedule and details page does not allow for the instructor key to be saved in other languages. The frontend expects that the key is in English. The key in varying languages is a bug introduced in the legacy page because of how it handled translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... we still have some corrupt data due to the legacy page then. If we are turning off the MFE and using legacy from time to time due to issues, would it be better to accept the corrupt data for now? When the serializer runs into an issue, it entirely shuts down course details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
allow_empty
should fix the issue for when there is corrupt data. In the edge case that you pointed out,Proffesseurs
is filtered out soinstructor_info
was empty. With this change, an empty dict will be sent via the API.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that specific code doesn't work but I get the general idea. I'll look into something that will pass checks.