def get_titles(cls, user=None): email = user.email() if user is not None else u'None' titles = caching.get_titles(email) if titles is None: titles = {page.title for page in cls.get_index(user)} caching.set_titles(email, titles) return titles
def get_titles(cls, user=None): email = user.email if (user is not None and not user.is_anonymous) else u'None' titles = caching.get_titles(email) if titles is None: titles = {page.title for page in cls.get_index(user)} caching.set_titles(email, titles) return titles