Beispiel #1
0
 def delete(self, project):
     self._validate_can_be('deleted', project)
     project = self.db.session.query(Project).filter(Project.id==project.id).first()
     self.db.session.delete(project)
     self.db.session.commit()
     cached_projects.delete_project(project.short_name)
     cached_projects.clean(project.id)
     self._delete_zip_files_from_store(project)
 def delete(self, project):
     self._validate_can_be("deleted", project)
     project = self.db.session.query(Project).filter(Project.id == project.id).first()
     self.db.session.delete(project)
     self.db.session.commit()
     cached_projects.delete_project(project.short_name)
     cached_projects.clean(project.id)
     self._delete_zip_files_from_store(project)
Beispiel #3
0
 def update(self, project):
     self._validate_can_be('updated', project)
     try:
         self.db.session.merge(project)
         self.db.session.commit()
         cached_projects.delete_project(project.short_name)
     except IntegrityError as e:
         self.db.session.rollback()
         raise DBIntegrityError(e)
Beispiel #4
0
 def update(self, project):
     self._validate_can_be('updated', project)
     try:
         self.db.session.merge(project)
         self.db.session.commit()
         cached_projects.delete_project(project.short_name)
     except IntegrityError as e:
         self.db.session.rollback()
         raise DBIntegrityError(e)
 def save(self, project):
     self._validate_can_be('saved', project)
     self._empty_strings_to_none(project)
     try:
         self.db.session.add(project)
         self.db.session.commit()
         cached_projects.delete_project(project.short_name)
     except IntegrityError as e:
         self.db.session.rollback()
         raise DBIntegrityError(e)
 def save(self, project):
     self._validate_can_be("saved", project)
     self._empty_strings_to_none(project)
     try:
         self.db.session.add(project)
         self.db.session.commit()
         cached_projects.delete_project(project.short_name)
     except IntegrityError as e:
         self.db.session.rollback()
         raise DBIntegrityError(e)
Beispiel #7
0
 def _refresh_cache(self, obj):
     cached_projects.delete_project(obj.short_name)
Beispiel #8
0
 def _refresh_cache(self, obj):
     cached_projects.delete_project(obj.short_name)