def make_json_error(ex): if isinstance(ex, werkzeug_exceptions.HTTPException): status_code = ex.code description = ex.description else: status_code = 500 description = str(ex) return api_utils.render({'error': status_code, 'error_message': description}, status=status_code)
def shopping_delete(shopping_id): _api.delete_lease(shopping_id) return api_utils.render()
def shopping_update(shopping_id, data): return api_utils.render(_api.update_shopping(shopping_id, data))
def shopping_get(shopping_id): return api_utils.render(_api.get_shopping(shopping_id))
def shopping_create(data): return api_utils.render(_api.create_shopping(data))
def shopping_list(): return api_utils.render(_api.get_shopping_list())