示例#1
0
 def form_valid(self, form):
     """
     Add a project key:value for the form, then get the object created by
     `form.save`.
     """
     form.instance.project = self.get_project()
     self.object = form.save()
     if hasattr(settings, "TESTING"):
         upload_zip(self.object)
     else:
         upload_zip.delay(self.object)
     return super(AddIndexView, self).form_valid(form)
示例#2
0
 def form_valid(self, form):
     """
     Add a project key:value for the form, then get the object created by
     `form.save`.
     """
     form.instance.project = self.get_project()
     self.object = form.save()
     if hasattr(settings, "TESTING"):
         upload_zip(self.object)
     else:
         upload_zip.delay(self.object)
     return super(AddIndexView, self).form_valid(form)
示例#3
0
 def form_valid(self, form):
     """
     Add a project key:value for the form, then get the object created by
     `form.save`.
     """
     form.instance.project = self.get_project()
     if hasattr(self.object, "celerytask"):
         self.object.celerytask.delete()
     if os.path.exists(self.get_index_path(self.object)):
         self.delete_folder_contents(self.get_index_path(self.object))
     self.object = form.save()
     # If we are in deployment mode, use the asynced version. If not, use the
     # synced version.
     if hasattr(settings, "TESTING"):
         upload_zip(self.object)
     else:
         upload_zip.delay(self.object)
     return super(IndexSettingsView, self).form_valid(form)
示例#4
0
 def form_valid(self, form):
     """
     Add a project key:value for the form, then get the object created by
     `form.save`.
     """
     form.instance.project = self.get_project()
     if hasattr(self.object, "celerytask"):
         self.object.celerytask.delete()
     if os.path.exists(self.get_index_path(self.object)):
         self.delete_folder_contents(self.get_index_path(self.object))
     self.object = form.save()
     # If we are in deployment mode, use the asynced version. If not, use the
     # synced version.
     if hasattr(settings, "TESTING"):
         upload_zip(self.object)
     else:
         upload_zip.delay(self.object)
     return super(IndexSettingsView, self).form_valid(form)