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>
Status: Maintenance Responsibilities ================ The Commerce app is an older implementation of e-commerce related functionality. Direction: Deprecate ==================== This app is replaced by functionality in the `ecommerce service`_. New functionality should not be added here. Effort is needed to determine who the existing clients are so they can be updated and this app can be removed. This app is in a similar situation to the ```lms/djangoapps/shoppingcart``` app. .. _ecommerce service: https://github.com/openedx/ecommerce Glossary ======== More Documentation ==================