diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2024-02-26 10:53:47 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-26 10:53:47 +0100 |
| commit | 18d79033b90902a6d6b615b42051191fd1b37892 (patch) | |
| tree | 7ae58fe68a09eb6190d02092c48e32e08ce497bc /django/db/backends/postgresql/base.py | |
| parent | 977d25416954a72ad100b01762078bf1ceb89a63 (diff) | |
Refs #34200 -- Removed unnecessary check in DatabaseWrapper.ensure_role() on PostgreSQL.
ensure_role() is only called in init_connection_state() where a new
connection is established.
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 96ba33a882..793a7bf3bc 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -296,8 +296,6 @@ class DatabaseWrapper(BaseDatabaseWrapper): return False def ensure_role(self): - if self.connection is None: - return False if new_role := self.settings_dict["OPTIONS"].get("assume_role"): with self.connection.cursor() as cursor: sql = self.ops.compose_sql("SET ROLE %s", [new_role]) |
