summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2024-02-26 10:53:47 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-26 10:53:47 +0100
commit18d79033b90902a6d6b615b42051191fd1b37892 (patch)
tree7ae58fe68a09eb6190d02092c48e32e08ce497bc /django/db/backends/postgresql
parent977d25416954a72ad100b01762078bf1ceb89a63 (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')
-rw-r--r--django/db/backends/postgresql/base.py2
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])