diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-07-28 17:42:52 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-07-28 08:42:52 -0400 |
| commit | 99e7bba443e3ff1a115d930dbb6dfcf9bccb027c (patch) | |
| tree | aa6c302a05add8184fa05f296ac59630fec4e052 /django/db | |
| parent | b61d5b1991e2ca2c3450ccc334224f3d51da39dc (diff) | |
Prevented query_utils.refs_expression() from looking for empty string in annotations map.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/query_utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index 0fedfac3e2..e3f6a730d5 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -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:] |
