tomchristie/django-rest-framework — pull request #1606 by dekkers (2014-05-28 22:27:09+00:00)
Title: Catch ProtectedError and return 409 Conflict

When we try to delete an object that has a reverse relation with on_delete set to PROTECT on the foreign key we will get a ProtectedError exception. This will catch the exception and return 409 Conflict instead of 500 Internal Server Errror. I am not really sure what the best status code should be in this case, 409 Conflict looks like the one that best matches what is going on.