Yeah, I can probably do that.

On Tue, Jan 15, 2013 at 11:31 PM, Jason Bau <notifications@github.com>wrote:

> In main/courses/common_page_data.py:
>
> > @@ -59,15 +65,28 @@ def get_common_page_data(request, prefix, suffix):
> >          view_mode = 'view'
> >
> >      # Course info pages
> > -    course_info_pages = []
> > -    for page in AdditionalPage.objects.getByCourseAndMenuSlug(course=course, menu_slug='course_info').all():
> > -        if view_mode == 'edit' or page.description:
> > -            course_info_pages.append(page)
> > +    course_info_page_handle = course_handle + '_course_info_pages'
> > +    course_info_pages = CACHE.get(course_info_page_handle)
> > +    if course_info_pages:
> > +        CacheStat.report('hit', CACHE_STORE)
> > +    else:
> > +        CacheStat.report('miss', CACHE_STORE)
> > +        course_info_pages = AdditionalPage.objects.filter(course=course,is_deleted=0,menu_slug='course_info').order_by('index')
> > +        CACHE.set(course_info_page_handle, course_info_pages)
> > +    if view_mode != 'edit':
>
> One last request: from grepping, it looks like this 'view_mode' thing is
> limited only to this file. We also never use the "view_mode" as a query
> parameter in the system -- in fact that introduces a weird state where
> course_info_pages depends on the 'view_mode' query_parameter but
> everything else depends on the course mode set by the toggler.
>
> So, long story short, can you do a code cleanup and nuke this view_modething entirely?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Stanford-Online/class2go/pull/1898/files#r2661937>.
>
>