Prevented query_utils.refs_expression() from looking for empty string in annotations map.
@@ -258,7 +258,7 @@ def refs_expression(lookup_parts, annotations):
Because the LOOKUP_SEP is contained in the default annotation names, check
each prefix of the lookup_parts for a match.
"""
- for n in range(len(lookup_parts) + 1):
+ for n in range(1, len(lookup_parts) + 1):
level_n_lookup = LOOKUP_SEP.join(lookup_parts[0:n])
if level_n_lookup in annotations and annotations[level_n_lookup]:
return annotations[level_n_lookup], lookup_parts[n:]
