Ensure errorModel unset property properly in while adding a new server. Fixes #1786

This commit is contained in:
Surinder Kumar 2016-10-03 13:50:54 +01:00 committed by Dave Page
parent a91f19a21d
commit e4d870cbe6

View File

@ -1573,6 +1573,7 @@
// After validation we need to set that value into model (only if all flags are true)
if (isValid) {
this.stopListening(this.model, "change:" + name, this.render);
this.model.errorModel.unset(name);
this.model.set(name, value);
this.listenTo(this.model, "change:" + name, this.render);
} else {
@ -1666,6 +1667,7 @@
// After validation we need to set that value into model (only if all flags are true)
if (isValid) {
this.stopListening(this.model, "change:" + name, this.render);
this.model.errorModel.unset(name);
this.model.set(name, value);
this.listenTo(this.model, "change:" + name, this.render);
} else {