Commit b2953fc4 by Kálmán Viktor

dashboard: create a new base vm on template 'clone'

parent 3d052db9
...@@ -778,9 +778,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView): ...@@ -778,9 +778,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
context = super(TemplateCreate, self).get_context_data(*args, **kwargs) context = super(TemplateCreate, self).get_context_data(*args, **kwargs)
context.update({ context.update({
'box_title': (_('Clone a template') 'box_title': _("Create a new base VM"),
if self.request.GET.get("parent").isdigit()
else _("Create a new base VM")),
'ajax_title': False, 'ajax_title': False,
'template': "dashboard/_template-create-2.html", 'template': "dashboard/_template-create-2.html",
}) })
...@@ -806,7 +804,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView): ...@@ -806,7 +804,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
form = self.form_class(request.POST, user=request.user) form = self.form_class(request.POST, user=request.user)
if not form.is_valid(): if not form.is_valid():
return self.get(request, form, *args, **kwargs) return self.get(request, form, *args, **kwargs)
elif form.cleaned_data.get("parent") is None: else:
post = form.cleaned_data post = form.cleaned_data
networks = self.__create_networks(post.pop("networks")) networks = self.__create_networks(post.pop("networks"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment