(user, domain_obj)
return CallCenterCaseAndOwner(case, owner_id)
Return the appropriate owner id for the given users call center case.
Return the appropriate owner id for the given users call center case.
Return the appropriate owner id for the given users call center case .
def _get_call_center_case_and_owner(user, domain_obj):
    """
    Return the appropriate owner id for the given users call center case.
    """
    config = domain_obj.call_center_config
    case = CaseAccessors(domain_obj.name).get_case_by_domain_hq_user_id(
        user._id, config.case_type
    )
    if config.use_user_location_as_owner:
        owner_id = _call_center_location_owner(user, config.user_location_ancestor_level)
    elif case and case.owner_id:
        owner_id = case.owner_id
    else:
        owner_id = config.case_owner_id
    return CallCenterCaseAndOwner(case, owner_id)
def _get_call_center_case_and_owner ( user , domain_obj ) : config = domain_obj . call_center_config case = CaseAccessors ( domain_obj . name ) . get_case_by_domain_hq_user_id ( user . _id , config . case_type ) if config . use_user_location_as_owner : owner_id = _call_center_location_owner ( user , config . user_location_ancestor_level ) elif case and case . owner_id : owner_id = case . owner_id else : owner_id = config . case_owner_id return CallCenterCaseAndOwner ( case , owner_id )