def compute_location(course_key, path, revision=None, is_thumbnail=False): """ Constructs a location object for static content. - course_key: the course that this asset belongs to - path: is the name of the static asset - revision: is the object's revision information - is_tumbnail: is whether or not we want the thumbnail version of this asset """ path = path.replace('/', '_') return AssetLocation(course_key.org, course_key.course, course_key.run, 'asset' if not is_thumbnail else 'thumbnail', AssetLocation.clean_keeping_underscores(path), revision)
def compute_location(course_key, path, revision=None, is_thumbnail=False): """ Constructs a location object for static content. - course_key: the course that this asset belongs to - path: is the name of the static asset - revision: is the object's revision information - is_thumbnail: is whether or not we want the thumbnail version of this asset """ path = path.replace('/', '_') return AssetLocation( course_key.org, course_key.course, course_key.run, 'asset' if not is_thumbnail else 'thumbnail', AssetLocation.clean_keeping_underscores(path), revision )