'In order for mapping to work, the locator must be minimal--no version, no branch--
as we never store one version or one branch in one ms and another in another ms.
:param locator: the CourseKey'

def _clean_locator_for_mapping(self, locator):

    if hasattr(locator, 'version_agnostic'):
        locator = locator.version_agnostic()
    if hasattr(locator, 'branch'):
        locator = locator.replace(branch=None)
    return locator
