Skip to content

Commit c7c97ae

Browse files
committed
Remove unnecessary getattr() call
BaseDatabaseWrapper always has an alias attribute. [1] [1] https://github.com/django/django/blob/aa28c392b9491f02330905cb73b7078b1cd18c60/django/db/backends/base/base.py#L70
1 parent c27ea4f commit c7c97ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/panels/sql/tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _record(self, method, sql, params):
156156
pass # object not JSON serializable
157157
template_info = get_template_info()
158158

159-
alias = getattr(self.db, "alias", "default")
159+
alias = self.db.alias
160160
conn = self.db.connection
161161
vendor = getattr(conn, "vendor", "unknown")
162162

0 commit comments

Comments
 (0)