Do proper validation in the server panel.

This commit is contained in:
Ashesh Vashi 2016-01-12 22:21:24 +05:30
parent 4feea580aa
commit eab12f21af

View File

@ -201,13 +201,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
errmsg;
if (!this.isNew() && 'id' in this.sessAttrs) {
var msg = '{{ _('Id can not be changed!') }}';
err['id'] = msg;
errmsg = msg;
err['id'] = '{{ _('Id can not be changed!') }}';;
errmsg = err['id'];
}
if (_.isUndefined(this.get('name')) || String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
err['name'] = '{{ _('Name can be empty!') }}';
errmsg = errmsg || msg;
errmsg = errmsg || err['name'];
}
this.errorModel.set(err);