-
- def get_instance_handler():
- # delete if applicable (will raise if not applicable to begin with)
- data.delete_policy_instance_if_applicable(policy_type_id, policy_instance_id)
-
- # raise 404 now that we may have deleted, or get the instance otherwise
- return data.get_policy_instance(policy_type_id, policy_instance_id), 200
-
- return _try_func_return(get_instance_handler)