Prevented query_utils.refs_expression() from looking for empty string in annotations map.

This commit is contained in:
Sergey Fedoseev 2017-07-28 17:42:52 +05:00 committed by Tim Graham
parent b61d5b1991
commit 99e7bba443
1 changed files with 1 additions and 1 deletions

View File

@ -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:]