Bug #1956: Template name is now mandatory

This commit is contained in:
Carlos Martín committed 2013-04-25 16:38:51 +02:00
1 parent e416b1e4b5
commit 2f22a18eaf
1 file changed
+9 -1
@@ -542,7 +542,7 @@ function generate_capacity_tab_content() {
'<input type="text" id="NAME" name="name"/>'+
'</div>'+
'<div class="one columns">'+
'<div class="tip">'+tr("Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-&lt;VID&gt;.")+'</div>'+
'<div class="tip">'+tr("Name that the VM will get for description purposes.")+'</div>'+
'</div>'+
'</div>'+
'<div class="row">'+
@@ -3512,6 +3512,14 @@ function setupCreateTemplateDialog(){
//wrap it in the "vmtemplate" object
var vm_json = build_template();
vm_json = {vmtemplate: vm_json};
if (vm_json.vmtemplate.NAME == undefined ||
vm_json.vmtemplate.NAME.length == 0 ) {
notifyError(tr("Virtual Machine name missing!"));
return false;
}
//validate form
Sunstone.runAction("Template.create",vm_json);