Beispiel #1
0
 def post(self, id):
     try:
         revision = RevisionService.get_by_id(id)
         RevisionService.sync_to_point(revision)
         db.session.commit()
     except RevisionService.RevisionServiceException as exc:
         db.session.rollback()
         error(unicode(exc))
         abort(404, message=unicode(exc))
     except Exception as exc:
         error(unicode(exc))
         db.session.rollback()
         raise
     return "ok"
Beispiel #2
0
    def post_save(self, obj, data, create_new=False):
        super(RevisionResource, self).post_save(obj, data, create_new)

        if create_new:
            RevisionService.initial_revision(obj)