def obj_create(self, bundle, request=None, **kwargs):
        request = request or bundle.request
        data = bundle.data.copy()

        try:
            status = data.pop("status")
            case = data.pop("case")
            env = Environment.objects.get(pk=data.get("environment"))
            run = data.pop("run_id")

        except KeyError as e:
            raise ValidationError(
                "bad result object data missing key: {0}".format(e))

        except Environment.DoesNotExist as e:
            raise ValidationError(
                "Specified environment does not exist: {0}".format(e))


        data["environment"] = env

        try:
            rcv = RunCaseVersion.objects.get(
                run__id=run,
                caseversion__case__id=case,
                environments=env,
                )

        except RunCaseVersion.DoesNotExist as e:
            raise ValidationError(
                "RunCaseVersion not found for run: {0}, case: {1}, environment: {2}:\nError {3}".format(
                        str(run), str(case), str(env), e))

        self.authorized_create_detail([rcv], bundle)
        data["user"] = request.user

        method = rcv.get_result_method(status)
        bundle.obj = method(**data)
        return bundle
Return the changes
dataset/ETHPy150Open mozilla/moztrap/moztrap/model/execution/api.py/ResultResource.obj_create--crossover with--dataset/ETHPy150Open saltstack/salt/salt/states/cron.py/_check_cron