[Bug 1570424] [NEW] [api] DELETE request for object with relationships returns 500

Public bug reported:

When attempting to delete an object with relations to other objects the
delete request fails with a 500 error and a stack trace.

Reproduce, attempt to send a DELETE request to:

The same response gets returned on 2.22.

I believe we should return a proper web message, so we can also inform
the user of why this object can not be deleted.

** Affects: dhis2
     Importance: Undecided
         Status: New

** Tags: api

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1570424

Title:
  [api] DELETE request for object with relationships returns 500

Status in DHIS:
  New

Bug description:
  When attempting to delete an object with relations to other objects
  the delete request fails with a 500 error and a stack trace.

  Reproduce, attempt to send a DELETE request to:
  DHIS 2 Demo - Sierra Leone

  The same response gets returned on 2.22.

  I believe we should return a proper web message, so we can also inform
  the user of why this object can not be deleted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1570424/+subscriptions

Bug confirmed. This happens due to a missing deletion handler method.

** Changed in: dhis2
    Milestone: None => 2.23

** Changed in: dhis2
     Assignee: (unassigned) => Lars Helge Øverland (larshelge)

** Changed in: dhis2
   Importance: Undecided => Low

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1570424

Title:
  [api] DELETE request for object with relationships returns 500

Status in DHIS:
  New

Bug description:
  When attempting to delete an object with relations to other objects
  the delete request fails with a 500 error and a stack trace.

  Reproduce, attempt to send a DELETE request to:
  DHIS 2 Demo - Sierra Leone

  The same response gets returned on 2.22.

  I believe we should return a proper web message, so we can also inform
  the user of why this object can not be deleted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1570424/+subscriptions

** Changed in: dhis2
       Status: New => Fix Committed

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1570424

Title:
  [api] DELETE request for object with relationships returns 500

Status in DHIS:
  Fix Committed

Bug description:
  When attempting to delete an object with relations to other objects
  the delete request fails with a 500 error and a stack trace.

  Reproduce, attempt to send a DELETE request to:
  DHIS 2 Demo - Sierra Leone

  The same response gets returned on 2.22.

  I believe we should return a proper web message, so we can also inform
  the user of why this object can not be deleted.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1570424/+subscriptions