Conversation
Add display_mode to the serialized fields for program objects across API versions so the attribute is included in responses. Updated BaseProgramSerializer (v1), ProgramSerializer (v2), and SimpleProgramSerializer (v3) to include display_mode.
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
Update tests to include the new 'display_mode' field in the expected serialized program output. The test now asserts 'display_mode': None for a program with empty requirements, matching the serializer's output change in courses/serializers/v2/programs_test.py.
for more information, see https://pre-commit.ci
…turned-in-the-api' of https://github.com/mitodl/mitxonline into 10405-add-display_mode-field-for-mitxonline-programs-returned-in-the-api
ChristopherChudzicki
approved these changes
Mar 10, 2026
Contributor
ChristopherChudzicki
left a comment
There was a problem hiding this comment.
👍 Working....Two requests, but neither warrants a re-review, IMO.
| search_fields = ["title", "readable_id", "program_type"] | ||
| list_display = ("id", "title", "live", "readable_id", "program_type") | ||
| list_filter = ["live", "program_type", "departments"] | ||
| list_display = ( |
Contributor
There was a problem hiding this comment.
We should add it to ProgramAdminForm.Meta.fields, too, so we can change it in Django Admin.
Co-authored-by: Chris Chudzicki <christopher.chudzicki@gmail.com>
…programs-returned-in-the-api
for more information, see https://pre-commit.ci
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/10405
Description (What does it do?)
Adds a
display_modefield to the Program model, and uses it in the APIs.How can this be tested?
Create a program and verify that APIs liek http://mitxonline.odl.local:8013/api/schema/swagger-ui/#/programs/programs_list_v2 return the display_mode field.