def remove_session(exc): if exc and not is_fake_error(exc): app.logger.exception("Rolling back database") Session.rollback() else: Session.commit() Session.remove()
def remove_session(exc): if exc and not is_fake_error(exc): app.logger.exception("Rolling back database") Session.rollback() else: Session.commit() Session.remove()