summaryrefslogtreecommitdiff
path: root/django/core/management
diff options
context:
space:
mode:
authorДилян Палаузов <dilyanpalauzov@users.noreply.github.com>2017-11-06 10:23:29 -0500
committerTim Graham <timograham@gmail.com>2017-11-07 09:08:46 -0500
commitc69e4bc69166b2d752b437a651dfa91f8b53ecfd (patch)
tree49cb2c1b54962eff1a02636062b213397003e7ed /django/core/management
parent00b93c2b1ecdda978f067309c6feafda633a7264 (diff)
Fixed #28769 -- Replaced 'x if x else y' with 'x or y'.
Diffstat (limited to 'django/core/management')
-rw-r--r--django/core/management/commands/makemessages.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 0151644a3a..f8c0da8388 100644
--- 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:
@@ -501,9 +501,7 @@ class Command(BaseCommand):
locale_dir = path
break
if not locale_dir:
- locale_dir = self.default_locale_path
- if not locale_dir:
- locale_dir = NO_LOCALE_DIR
+ locale_dir = self.default_locale_path or NO_LOCALE_DIR
all_files.append(self.translatable_file_class(dirpath, filename, locale_dir))
return sorted(all_files)