diff --git a/dao/dao_test.go b/dao/dao_test.go index 2a8f5e47a..fc45fe672 100644 --- a/dao/dao_test.go +++ b/dao/dao_test.go @@ -1376,7 +1376,7 @@ func TestDeleteRepPolicy(t *testing.T) { if err != nil && err != orm.ErrNoRows { t.Errorf("Error occured in GetRepPolicy:%v", err) } - if p != nil { + if p != nil && p.Deleted != 1 { t.Errorf("Able to find rep policy after deletion, id: %d", policyID) } } diff --git a/dao/replication_job.go b/dao/replication_job.go index 3d0f46c40..2718eaea8 100644 --- a/dao/replication_job.go +++ b/dao/replication_job.go @@ -156,7 +156,7 @@ func FilterRepPolicies(name string, projectID int64) ([]*models.RepPolicy, error left join replication_target rt on rp.target_id=rt.id left join replication_job rj on rp.id=rj.policy_id and (rj.status="error" or rj.status="retrying") - where rp.delete = 0 ` + where rp.deleted = 0 ` if len(name) != 0 && projectID != 0 { sql += `and rp.name like ? and rp.project_id = ? `