diff options
| author | nessita <124304+nessita@users.noreply.github.com> | 2024-07-15 16:20:24 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-15 16:20:24 -0300 |
| commit | 082fe2b5a83571dec4aa97580af0fe8cf2a5214e (patch) | |
| tree | f93b31985d6b975e304c3456195aaf174ce79c71 /django/db/models/sql | |
| parent | 27043bde5b795eb4a605aeca1d3bc4345d2ca478 (diff) | |
Removed leftover KeyError handling after Query.tables attribute cleanup.
Follow up from f7f5edd50d03e8482f8a6da5fb5202b895d68cd6.
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/compiler.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index f3aed06d81..fe22163961 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -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) |
