Esempio n. 1
0
 def post(self, *args, **kwargs):
     self.form = PrepareMassDeploymentForm(self.request.POST)
     if self.form.is_valid():
         csv = self.form.cleaned_data['csv'].strip()
         mass_deployment = MassDeploymentModel(csv=csv)
         mass_deployment.created_by = self.request.user.get_profile()
         mass_deployment.save()
         return HttpResponseRedirect('/ui/deployment/mass/define/%s/' %
                                     mass_deployment.pk)
     messages.error(self.request, "Please correct the errors.")
     return super(PrepareMassDeployment, self).get(*args, **kwargs)
Esempio n. 2
0
class PrepareMassDeployment(Base):
    template_name = 'ui/mass_deploy.html'

    def get_context_data(self, *args, **kwargs):
        ret = super(
            PrepareMassDeployment, self
        ).get_context_data(*args, **kwargs)
        ret.update({
            'form': self.form,
            'action_name': 'Next step'
        })
        ret['template_menu_items'] = TEMPLATE_MENU_ITEMS
        ret['template_selected'] = 'servers'
        return ret

    def get(self, *args, **kwargs):
        self.form = PrepareMassDeploymentForm()
        return super(
            PrepareMassDeployment, self
        ).get(*args, **kwargs)

    def post(self, *args, **kwargs):
        self.form = PrepareMassDeploymentForm(self.request.POST)
        if self.form.is_valid():
            csv = self.form.cleaned_data['csv'].strip()
            mass_deployment = MassDeploymentModel(csv=csv)
            mass_deployment.created_by = self.request.user.get_profile()
            mass_deployment.save()
            return HttpResponseRedirect(
                '/ui/deployment/mass/define/%s/' % mass_deployment.pk
            )
        messages.error(self.request, "Please correct the errors.")
        return super(
            PrepareMassDeployment, self
        ).get(*args, **kwargs)
Esempio n. 3
0
class PrepareMassDeployment(Base):
    submodule_name = 'racks'
    template_name = 'ui/mass_deploy.html'

    def get_context_data(self, *args, **kwargs):
        ret = super(PrepareMassDeployment,
                    self).get_context_data(*args, **kwargs)
        ret.update({'form': self.form, 'action_name': 'Next step'})
        ret['template_menu_items'] = TEMPLATE_MENU_ITEMS
        ret['template_selected'] = 'servers'
        return ret

    def get(self, *args, **kwargs):
        self.form = PrepareMassDeploymentForm()
        return super(PrepareMassDeployment, self).get(*args, **kwargs)

    def post(self, *args, **kwargs):
        self.form = PrepareMassDeploymentForm(self.request.POST)
        if self.form.is_valid():
            csv = self.form.cleaned_data['csv'].strip()
            mass_deployment = MassDeploymentModel(csv=csv)
            mass_deployment.created_by = self.request.user.get_profile()
            mass_deployment.save()
            return HttpResponseRedirect('/ui/deployment/mass/define/%s/' %
                                        mass_deployment.pk)
        messages.error(self.request, "Please correct the errors.")
        return super(PrepareMassDeployment, self).get(*args, **kwargs)
Esempio n. 4
0
 def post(self, *args, **kwargs):
     self.form = PrepareMassDeploymentForm(self.request.POST)
     if self.form.is_valid():
         csv = self.form.cleaned_data['csv'].strip()
         mass_deployment = MassDeploymentModel(csv=csv)
         mass_deployment.created_by = self.request.user.get_profile()
         mass_deployment.save()
         return HttpResponseRedirect(
             '/ui/deployment/mass/define/%s/' % mass_deployment.pk
         )
     messages.error(self.request, "Please correct the errors.")
     return super(
         PrepareMassDeployment, self
     ).get(*args, **kwargs)
Esempio n. 5
0
 def get(self, *args, **kwargs):
     self.form = PrepareMassDeploymentForm()
     return super(
         PrepareMassDeployment, self
     ).get(*args, **kwargs)
Esempio n. 6
0
 def get(self, *args, **kwargs):
     self.form = PrepareMassDeploymentForm()
     return super(PrepareMassDeployment, self).get(*args, **kwargs)