'Returns the Location that is for the current branch setting.'

def for_branch_setting(self, location):

    if (location.category in DIRECT_ONLY_CATEGORIES):
        return location.replace(revision=MongoRevisionKey.published)
    if (self.get_branch_setting() == ModuleStoreEnum.Branch.draft_preferred):
        return location.replace(revision=MongoRevisionKey.draft)
    return location.replace(revision=MongoRevisionKey.published)
