-
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: instructor info in course details api #34760
fix: instructor info in course details api #34760
Conversation
@@ -10,10 +10,10 @@ | |||
class InstructorInfoSerializer(serializers.Serializer): | |||
""" Serializer for instructor info """ | |||
name = serializers.CharField(allow_blank=True) |
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.
Should this also be required=False
?
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'm assuming there has to at least be a name for instructor_info, though I'm not completely sure. The specific issue that courses have been running into is a missing organization field.
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
Scheduling and Details page will sometimes error out due to
KeyError: "Got KeyError when attempting to get a value for field
organizationon serializer
InstructorInfoSerializer.\nThe serializer field might be named incorrectly and not match any attribute or key on the
dictinstance.\nOriginal exception text was: 'organization'."
. Theorganization
field is missing when serializing instructor info, which causes this error.This PR addresses this by making some fields in instructor info not required, mimicking legacy behavior.
Supporting information
https://2u-internal.atlassian.net/browse/TNL-11484
Testing instructions
Smoke test Scheduling and Details page to make sure this change does not break anything.