Skip to content

fix: Multi Select course/course run issue#4714

Closed
skumargupta83 wants to merge 1 commit intoopenedx:masterfrom
skumargupta83:bug/CATALOG-44-2
Closed

fix: Multi Select course/course run issue#4714
skumargupta83 wants to merge 1 commit intoopenedx:masterfrom
skumargupta83:bug/CATALOG-44-2

Conversation

@skumargupta83
Copy link
Copy Markdown
Contributor

https://2u-internal.atlassian.net/browse/CATALOG-44

Unable to Enter Course and Org Data- Discovery

Description

A recent update in the Discovery is preventing users from entering information in the Courses and Authoring Organization fields. This is impacting high-priority program operations, specifically for Google Cloud initiatives that require quick turnaround. The affected user reported being unable to input necessary data in these fields and requests an urgent resolution to restore data entry capabilities

Acceptance Criteria :

The Courses and Authoring Organization fields must allow data entry without errors for all users.
No existing programs or scheduled launches should be disrupted during the patch or rollback.

@skumargupta83 skumargupta83 force-pushed the bug/CATALOG-44-2 branch 8 times, most recently from 321ae47 to 1fc5760 Compare April 10, 2026 06:25
Copy link
Copy Markdown

@ankit-sonata ankit-sonata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are overly “implementation-detail heavy” and may be brittle

DALAdminMixinTests asserts exact tuples and exact ordering/length of media assets. This will be fragile if upstream changes asset names/paths or admin media composition.
Prefer testing the behavioral requirement: “Select2 appears before autocomplete.js” and “required assets are included”, rather than full equality of tuples.
test_widgets.py additions are too mock-y and don’t strongly validate the real bug

Many tests patch DAL base methods and then assert shallow properties (e.g., “doesn’t crash”, “result is not None”).
Suggest focusing on 2–3 high-value tests:
optgroups preserves order of selected values (core bug),
handles missing/empty items safely,
ensures data-role="autocomplete" ends up in rendered widget attrs (if that’s truly required).

@skumargupta83
Copy link
Copy Markdown
Contributor Author

Hi @ankit-sonata,
Thanks for pointing that out. I understand the concern about fragility with exact tuple assertions. In this case, the current approach was chosen to ensure deterministic ordering and asset inclusion during testing. While I see the value in focusing on behavioral requirements, I’d prefer to keep the existing checks for now to maintain consistency with our current test suite.

@iloveagent57
Copy link
Copy Markdown
Contributor

an alternative proposed approach to this issue: #4718
but fundamentally, we have to drop DAL as a dependency, it's not django 5 compatible and appears unmaintained.

Copy link
Copy Markdown

@ankit-sonata ankit-sonata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Change DALAdminMixin to not inherit from ModelAdmin (make it a plain class/object)
  • Remove duplicated Media CSS/JS from CourseAdmin and ProgramAdmin inner Media classes, OR remove the mixin and keep everything inline — pick one pattern
  • Remove the no-op media property from SortedModelSelect2Multiple

@skumargupta83
Copy link
Copy Markdown
Contributor Author

As discussed with @iloveagent57, I am closing PR #4714 and continuing with PR #4718. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants