summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/creation.py
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2018-01-03 18:52:12 -0500
committerTim Graham <timograham@gmail.com>2018-01-03 20:12:23 -0500
commitd7b2aa24f75434c2ce50100cfef3586071e0747a (patch)
tree9074eb7522888e744f948c52174f367a4281c200 /django/db/backends/postgresql/creation.py
parentc2d0f8c084456b5073252a91eeb09ab3d7453b18 (diff)
downloaddjango-d7b2aa24f75434c2ce50100cfef3586071e0747a.tar.gz
Fixed #28982 -- Simplified code with and/or.
Diffstat (limited to 'django/db/backends/postgresql/creation.py')
-rw-r--r--django/db/backends/postgresql/creation.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/creation.py b/django/db/backends/postgresql/creation.py
index a93bdbb4a1..0169fc5c1f 100644
--- a/django/db/backends/postgresql/creation.py
+++ b/django/db/backends/postgresql/creation.py
@@ -16,9 +16,7 @@ class DatabaseCreation(BaseDatabaseCreation):
suffix += " ENCODING '{}'".format(encoding)
if template:
suffix += " TEMPLATE {}".format(self._quote_name(template))
- if suffix:
- suffix = "WITH" + suffix
- return suffix
+ return suffix and "WITH" + suffix
def sql_table_creation_suffix(self):
test_settings = self.connection.settings_dict['TEST']