Yeah, so I fixed this by putting a decorator on relevant is_viewable
methods that checks for request.couch_user.


2013/1/25 Mike White <notifications@github.com>

> In corehq/apps/hqwebapp/templatetags/menu_tags.py:
>
> >      request = context['request']
> >      domain = context.get('domain')
> > -    for m in menu_items:
> > -        menu_item_class = to_function(m)
> > -        try:
> > -            viewable = menu_item_class.is_viewable(request, domain)
> > -        except AttributeError:
>
> Yeah, I verified that all existing menu items have an is_viewable
> attribute and concluded that this try-except was left over from a time when
> that was not the case, and never came across that edge case when testing. I
> probably should have realized that it might be catching an AttributeError
> deeper in the call stack, but this could have also been avoided by using except
> Exception, which is really what this means, or not using exceptions to
> implement program logic for non-exceptional cases.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dimagi/core-hq/pull/503/files#r2778409>.
>
>