[FIX] forbid spaces in db names

lp bug: https://launchpad.net/bugs/916771 fixed

bzr revid: xmo@openerp.com-20120117120035-n7kk3uzfqwdgkm88
This commit is contained in:
Xavier Morel
2012-01-17 13:00:35 +01:00
parent 24ef362e7f
commit 1a0e9063d4
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -280,6 +280,9 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
init: function(parent, element_id, option_id) {
this._super(parent, element_id);
this.unblockUIFunction = $.unblockUI;
$.validator.addMethod('matches', function (s, _, re) {
return new RegExp(re).test(s);
}, _t("Invalid database name"));
},
start: function() {
this.$option_id = $("#oe_db_options");
+2 -1
View File
@@ -70,7 +70,8 @@
</tr>
<tr>
<td><label for="db_name">New database name:</label></td>
<td><input type="text" name="db_name" class="required"/></td>
<td><input type="text" name="db_name"
class="required" matches="^[a-zA-Z][a-zA-Z0-9_]+$"/></td>
</tr>
<tr>
<td><label for="demo_data">Load Demonstration data:</label></td>