Merge pull request #691 from ywk253100/policy_deletion

Bug fix for policy deletion: read wrong column name
This commit is contained in:
Wenkai Yin 2016-08-18 12:03:02 +08:00 committed by GitHub
commit e0649f6d69
2 changed files with 2 additions and 2 deletions

View File

@ -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)
}
}

View File

@ -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 = ? `