Esempio n. 1
0
    def save(self, commit=True):
        project = super(ProjectForm, self).save(commit=False)
        project.save()

        # Create a the first project_version
        create_new_version(project, 1, self.uploaded_catalog)

        return project
Esempio n. 2
0
 def save(self, commit=True):
     project = super(ProjectForm, self).save(commit=False)
     project.save()
     
     # Create a the first project_version
     create_new_version(project, 1, self.uploaded_catalog)
         
     return project
Esempio n. 3
0
 def save(self, commit=True):
     project = super(ProjectForm, self).save(commit=False)
     
     if commit:
         if self.uploaded_catalog:
             previous_version = project.get_current_version()
             current_version = create_new_version(project, previous_version.version+1, self.uploaded_catalog)
             update_catalogs(project, previous_version, current_version)
         project.save()
         
     return project
Esempio n. 4
0
    def save(self, commit=True):
        project = super(ProjectForm, self).save(commit=False)

        if commit:
            if self.uploaded_catalog:
                previous_version = project.get_current_version()
                current_version = create_new_version(
                    project, previous_version.version + 1,
                    self.uploaded_catalog)
                update_catalogs(project, previous_version, current_version)
            project.save()

        return project
Esempio n. 5
0
 def save(self, **kwargs):
     """
     Override the save method to update template and catalog from the given POT
     """
     super(ProjectCurrentSerializer, self).save(**kwargs)
     
     if hasattr(self, 'uploaded_pot_file'):
         previous_version = self.object.get_current_version()
         current_version = create_new_version(self.object, previous_version.version+1, self.uploaded_pot_file)
         update_catalogs(self.object, previous_version, current_version)
         self.object.save()
      
     return self.object
Esempio n. 6
0
    def save(self, **kwargs):
        """
        Override the save method to update template and catalog from the given POT
        """
        super(ProjectCurrentSerializer, self).save(**kwargs)

        if hasattr(self, 'uploaded_pot_file'):
            previous_version = self.object.get_current_version()
            current_version = create_new_version(self.object,
                                                 previous_version.version + 1,
                                                 self.uploaded_pot_file)
            update_catalogs(self.object, previous_version, current_version)
            self.object.save()

        return self.object