﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28769	Utilize 'x or y' in place of 'x if x else y'	Дилян Палаузов	nobody	"{{{
diff --git a/django/contrib/admin/bin/compress.py b/django/contrib/admin/bin/compress.py
--- a/django/contrib/admin/bin/compress.py
+++ b/django/contrib/admin/bin/compress.py
@@ -28,7 +28,7 @@ Compiler library and Java version 6 or later.""""""
     parser.add_argument(""-q"", ""--quiet"", action=""store_false"", dest=""verbose"")
     options = parser.parse_args()
 
-    compiler = Path(closure_compiler if closure_compiler else options.compiler).expanduser()
+    compiler = Path(closure_compiler or options.compiler).expanduser()
     if not compiler.exists():
         sys.exit(
             ""Google Closure compiler jar file %s not found. Please use the -c ""
diff --git a/django/contrib/gis/gdal/raster/base.py b/django/contrib/gis/gdal/raster/base.py
--- a/django/contrib/gis/gdal/raster/base.py
+++ b/django/contrib/gis/gdal/raster/base.py
@@ -56,7 +56,7 @@ class GDALRasterBase(GDALBase):
                 counter += 1
                 item = data[counter]
             # The default domain values are returned if domain is None.
-            result[domain if domain else 'DEFAULT'] = domain_meta
+            result[domain or 'DEFAULT'] = domain_meta
         return result
 
     @metadata.setter
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -323,9 +323,9 @@ class Command(BaseCommand):
             raise CommandError(""currently makemessages only supports domains ""
                                ""'django' and 'djangojs'"")
         if self.domain == 'djangojs':
-            exts = extensions if extensions else ['js']
+            exts = extensions or  ['js']
         else:
-            exts = extensions if extensions else ['html', 'txt', 'py']
+            exts = extensions or ['html', 'txt', 'py']
         self.extensions = handle_extensions(exts)
 
         if (locale is None and not exclude and not process_all) or self.domain is None:
diff --git a/django/db/backends/base/introspection.py b/django/db/backends/base/introspection.py
--- a/django/db/backends/base/introspection.py
+++ b/django/db/backends/base/introspection.py
@@ -130,7 +130,7 @@ class BaseDatabaseIntrospection:
                     # we don't need to reset the sequence.
                     if f.remote_field.through is None:
                         sequence = self.get_sequences(cursor, f.m2m_db_table())
-                        sequence_list.extend(sequence if sequence else [{'table': f.m2m_db_table(), 'column': None}])
+                        sequence_list.extend(sequence or [{'table': f.m2m_db_table(), 'column': None}])
         return sequence_list
 
     def get_sequences(self, cursor, table_name, table_fields=()):
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -606,7 +606,7 @@ class Query:
 
         # Ordering uses the 'rhs' ordering, unless it has none, in which case
         # the current ordering is used.
-        self.order_by = rhs.order_by if rhs.order_by else self.order_by
+        self.order_by = rhs.order_by or self.order_by
         self.extra_order_by = rhs.extra_order_by or self.extra_order_by
 
     def deferred_to_data(self, target, callback):
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -474,7 +474,7 @@ class DateTimeBaseInput(TextInput):
 
     def __init__(self, attrs=None, format=None):
         super().__init__(attrs)
-        self.format = format if format else None
+        self.format = format or None
 
     def format_value(self, value):
         return formats.localize_input(value, self.format or formats.get_format(self.format_key)[0])
}}}"	Cleanup/optimization	closed	Core (Other)	1.11	Normal	fixed			Ready for checkin	1	0	0	0	0	0
