that "should not" happen


On Thu, Jun 20, 2013 at 6:49 PM, Cory Zue <notifications@github.com> wrote:

> In corehq/apps/cloudcare/api.py:
>
> > @@ -160,6 +163,15 @@ def keys():
> >          ids = [res["id"] for res in view_results]
> >          return self._case_results(ids)
> >
> > +def link_locations(base_results):
> > +    """annotate case results with info from linked location doc (if any)"""
> > +    loc_ids = set(match.couch_doc.location_[-1] for match in base_results if hasattr(match.couch_doc, 'location_'))
> > +    locs = dict((loc._id, loc) for loc in Location.view('_all_docs', keys=list(loc_ids), include_docs=True))
> > +    for match in base_results:
> > +        if hasattr(match.couch_doc, 'location_'):
> > +            loc_id = match.couch_doc.location_[-1]
>
> do we need to worry about location_ being an empty array here?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dimagi/commcare-hq/pull/490/files#r4809627>
> .
>