Where: DELETE /api/libraries/v2/<lib>/ (content_libraries/rest_api/libraries.py
delete → api/libraries.py delete_library) on Tutor main (edx-platform master e2e8edf73f).
What happens: a library that only ever held components deletes cleanly
(200 {}, then 404). A library that has had a unit/subsection/section, or a
publish with side effects, answers 500 {"error": "The Studio servers encountered an error"}; the CMS log shows django.db.models.deletion.RestrictedError: Cannot delete some instances of model 'LearningPackage' because they are referenced through restricted foreign keys: 'EntityListRow.entity', 'DraftSideEffect.cause', 'DraftSideEffect.effect', 'PublishSideEffect.cause', 'PublishSideEffect.effect'.
Expected: Probably a descriptive 400 error
Where:
DELETE /api/libraries/v2/<lib>/(content_libraries/rest_api/libraries.pydelete→api/libraries.pydelete_library) on Tutormain(edx-platform mastere2e8edf73f).What happens: a library that only ever held components deletes cleanly
(
200 {}, then404). A library that has had a unit/subsection/section, or apublish with side effects, answers
500 {"error": "The Studio servers encountered an error"}; the CMS log showsdjango.db.models.deletion.RestrictedError: Cannot delete some instances of model 'LearningPackage' because they are referenced through restricted foreign keys: 'EntityListRow.entity', 'DraftSideEffect.cause', 'DraftSideEffect.effect', 'PublishSideEffect.cause', 'PublishSideEffect.effect'.Expected: Probably a descriptive 400 error