Beispiel #1
0
 def post(self, request, *args, **kwargs):
     ota_enrollment_form = OTAEnrollmentForm(request.POST, prefix="oe")
     ota_enrollment_secret_form = OTAEnrollmentSecretForm(request.POST, prefix="oes")
     if ota_enrollment_form.is_valid() and ota_enrollment_secret_form.is_valid():
         ota_enrollment = ota_enrollment_form.save(commit=False)
         ota_enrollment.enrollment_secret = ota_enrollment_secret_form.save()
         ota_enrollment.save()
         return HttpResponseRedirect(reverse("mdm:ota_enrollment",
                                             args=(ota_enrollment.pk,)))
     else:
         return self.render_to_response(
             self.get_context_data(ota_enrollment_form=ota_enrollment_form,
                                   ota_enrollment_secret_form=ota_enrollment_secret_form)
         )
Beispiel #2
0
 def post(self, request, *args, **kwargs):
     ota_enrollment_form = OTAEnrollmentForm(request.POST, prefix="oe")
     enrollment_secret_form = EnrollmentSecretForm(request.POST,
                                                   prefix="es")
     if ota_enrollment_form.is_valid() and enrollment_secret_form.is_valid(
     ):
         ota_enrollment = ota_enrollment_form.save(commit=False)
         ota_enrollment.enrollment_secret = enrollment_secret_form.save()
         enrollment_secret_form.save_m2m()
         ota_enrollment.save()
         return redirect(ota_enrollment)
     else:
         return self.render_to_response(
             self.get_context_data(
                 ota_enrollment_form=ota_enrollment_form,
                 enrollment_secret_form=enrollment_secret_form))
Beispiel #3
0
 def post(self, request, *args, **kwargs):
     ota_enrollment_form = OTAEnrollmentForm(request.POST, prefix="oe")
     enrollment_secret_form = EnrollmentSecretForm(
         request.POST,
         prefix="es",
         meta_business_unit=self.meta_business_unit,
     )
     if ota_enrollment_form.is_valid() and enrollment_secret_form.is_valid():
         ota_enrollment = ota_enrollment_form.save(commit=False)
         ota_enrollment.enrollment_secret = enrollment_secret_form.save()
         enrollment_secret_form.save_m2m()
         ota_enrollment.save()
         return HttpResponseRedirect(ota_enrollment.get_absolute_url())
     else:
         return self.render_to_response(
             self.get_context_data(ota_enrollment_form=ota_enrollment_form,
                                   enrollment_secret_form=enrollment_secret_form)
         )