(cls, build, build_profile_id, active)
create a new object or just set the status of an existing one for an app
        build and build profile to the status passed
        :param active: to be set as active, True/False
create a new object or just set the status of an existing one for an app
        build and build profile to the status passed
        :param active: to be set as active, True/False
create a new object or just set the status of an existing one for an app build and build profile to the status passed : param active : to be set as active True / False
def update_status(cls, build, build_profile_id, active):
        """
        create a new object or just set the status of an existing one for an app
        build and build profile to the status passed
        :param active: to be set as active, True/False
        """
        app_id = build.copy_of
        build_id = build.get_id
        version = build.version
        try:
            build_profile = LatestEnabledBuildProfiles.objects.get(
                app_id=app_id,
                version=version,
                build_profile_id=build_profile_id,
                build_id=build_id
            )
        except cls.DoesNotExist:
            build_profile = LatestEnabledBuildProfiles(
                app_id=app_id,
                version=version,
                build_profile_id=build_profile_id,
                build_id=build_id,
                domain=build.domain
            )
        # assign it to avoid re-fetching during validations
        build_profile._build = build
        build_profile.activate() if active else build_profile.deactivate()
def update_status ( cls , build , build_profile_id , active ) : app_id = build . copy_of build_id = build . get_id version = build . version try : build_profile = LatestEnabledBuildProfiles . objects . get ( app_id = app_id , version = version , build_profile_id = build_profile_id , build_id = build_id ) except cls . DoesNotExist : build_profile = LatestEnabledBuildProfiles ( app_id = app_id , version = version , build_profile_id = build_profile_id , build_id = build_id , domain = build . domain ) # assign it to avoid re-fetching during validations build_profile . _build = build build_profile . activate ( ) if active else build_profile . deactivate ( )