mirror of
https://github.com/django/django.git
synced 2025-03-29 02:30:48 +00:00
Removed leftover KeyError handling after Query.tables attribute cleanup.
Follow up from f7f5edd50d03e8482f8a6da5fb5202b895d68cd6.
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…
x
Reference in New Issue
Block a user