(form, attachment_name)
Attempts to build and return a question_id from retrieved path list
Attempts to build and return a question_id from retrieved path list
Attempts to build and return a question_id from retrieved path list
def _get_question_id_for_attachment(form, attachment_name):
    """
    Attempts to build and return a question_id from retrieved path list
    """
    question_id_components = _find_path_to_question_id(form, attachment_name, use_basename=False)

    # NOTE: until rd-toolkit bug is fixed, search for question_id again looking at basename of attachment_name
    # See https://dimagi-dev.atlassian.net/browse/SAAS-11792
    if question_id_components is None:
        question_id_components = _find_path_to_question_id(form, attachment_name, use_basename=True)

    if question_id_components is not None:
        return str('-'.join(question_id_components))
    else:
        return None
def _get_question_id_for_attachment ( form , attachment_name ) : question_id_components = _find_path_to_question_id ( form , attachment_name , use_basename = False ) # NOTE: until rd-toolkit bug is fixed, search for question_id again looking at basename of attachment_name # See https://dimagi-dev.atlassian.net/browse/SAAS-11792 if question_id_components is None : question_id_components = _find_path_to_question_id ( form , attachment_name , use_basename = True ) if question_id_components is not None : return str ( '-' . join ( question_id_components ) ) else : return None