mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
return 412 when deleting a target used by a policy, fix #1881
This commit is contained in:
parent
2092387e18
commit
f0f305a69c
@ -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