mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-25 18:18:04 +01:00
Merge pull request #1887 from ywk253100/170330_delete_endpoint
Return 412 when deleting a target used by a policy
This commit is contained in:
commit
aed804d8c4
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user