Merge pull request #1887 from ywk253100/170330_delete_endpoint

Return 412 when deleting a target used by a policy
This commit is contained in:
Daniel Jiang 2017-03-30 19:14:18 +08:00 committed by GitHub
commit aed804d8c4

View File

@ -328,7 +328,7 @@ func (t *TargetAPI) Delete() {
}
if len(policies) > 0 {
t.CustomAbort(http.StatusBadRequest, "the target is used by policies, can not be deleted")
t.CustomAbort(http.StatusPreconditionFailed, "the target is used by policies, can not be deleted")
}
if err = dao.DeleteRepTarget(id); err != nil {