Both 'provider' and 'provider_type' have been used for storing the discussion provider type in course 'discussions_settings' field, there are some places in the code checking for 'provider' and others checking for 'provider_type', in some cases this can cause a bug where it doesn't detect the correct provider which causes discussion settings not being copied correctly when a course is cloned.
This change prioritises the `provider_type` setting over `provider` and reads `provider` only as a fallback. The `provider` setting is now made read-only just for backwards-compatibility, to avoid confusion.
Returns HTTP 400 for disallowed enrollments instead of HTTP 500.
Prevents infinite loading spinners on the enrollment page.
Displays clear error messages to users before redirection.
Ensures consistent and meaningful responses from enrollment API endpoints.
* fix: commerce and enrollment apis return 403 when enrollment not allowed
* fix: now both apis send the right message and http code when enrollment fails
* fix: InvalidEnrollmentAtribute as final exception to catch and HTTP 400 returned
* style: the message is displayed as a popup instead of creating a div at the end
* fix: import not used removed for pylint checks
* style: popup now use utility classes
* refactor: use const instead of let for existing const
* refactor: textContent const structure changed due check failed
* refactor: SetTimeout settled as arrow function
* feat: button incorporated to bring users enough time to read the message
* refactor: ErrorStatuses defined at the top of the file to use it in conditionals
* style: typo fixed
Co-authored-by: Diana Olarte <dcoa@live.com>
* refactor: double validation of redirectUrl eliminated and better styling of the message
Co-authored-by: Diana Olarte <dcoa@live.com>
* refactor: redirectUrl param eliminated in showmessage function, close button redirects to dashboard always
* docs: remove unused redirectUrl param from JSDoc and explain hardcoded URL
* style: endline added
* feat: enrollmentNotAllowed exception added in views and the js
* docs: comment added to especify exception
* style: endline added
* refactor: error statuses velidation changed to one single validation instead of two
* refactor: function added to handle enrollment errors
* feat: enrollmentNotAllowed exception added for API coherence and consistency
* style: empty line added
* style: pylint check line too long disabled
---------
Co-authored-by: Diana Olarte <dcoa@live.com>
feat: added account level pref model in notification task
feat: added handler for preference creation on user signup
feat: added unit tests for account level preferences
* fix: removed app level check in notifications
* fix: updated flaky test
The CookieNameChange middleware has been removed. Originally a temporary
measure slated for removal by October 1, 2021, it facilitated a transitional cookie
migration pattern that is no longer required.
This action addresses DEPR:
https://github.com/openedx/edx-platform/issues/36834