def get_environment_by_id(environment_id): """Return a environment by id. Args: environment_id: Id of environment """ try: environment = Ambiente.get_by_pk(id=environment_id) except AmbienteNotFoundError, e: raise exceptions.EnvironmentDoesNotExistException(str(e))
def get_environment_by_id(environment_id): """ Return a environment by id :param environment_id: id of environment """ try: environment = Ambiente.objects.get(id=environment_id) except ObjectDoesNotExist: raise exceptions.EnvironmentDoesNotExistException() return environment