mirror of https://github.com/django/django.git
Removed leftover KeyError handling after Query.tables attribute cleanup.
Follow up from f7f5edd50d
.
This commit is contained in:
parent
27043bde5b
commit
082fe2b5a8
|
@ -1134,15 +1134,9 @@ class SQLCompiler:
|
|||
"""
|
||||
result = []
|
||||
params = []
|
||||
for alias in tuple(self.query.alias_map):
|
||||
for alias, from_clause in tuple(self.query.alias_map.items()):
|
||||
if not self.query.alias_refcount[alias]:
|
||||
continue
|
||||
try:
|
||||
from_clause = self.query.alias_map[alias]
|
||||
except KeyError:
|
||||
# Extra tables can end up in self.tables, but not in the
|
||||
# alias_map if they aren't in a join. That's OK. We skip them.
|
||||
continue
|
||||
clause_sql, clause_params = self.compile(from_clause)
|
||||
result.append(clause_sql)
|
||||
params.extend(clause_params)
|
||||
|
|
Loading…
Reference in New Issue