diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-10-27 09:35:01 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-10-27 13:59:09 +0100 |
| commit | 6a1bd837b108d968d4cb552320ab4b7472f10c3f (patch) | |
| tree | 4d450b60d10b98e0f978d72acbd40566f07bfdaf | |
| parent | abee4f718e6f08b523fc61fb812ef88d13a2e4b2 (diff) | |
[1.7.x] Fixed #23717 -- Fixed makemessages crash when STATIC_ROOT=None
Backport of 528c9af54 from master.
| -rw-r--r-- | django/core/management/commands/makemessages.py | 2 | ||||
| -rw-r--r-- | docs/releases/1.7.2.txt | 3 | ||||
| -rw-r--r-- | tests/i18n/test_extraction.py | 8 |
3 files changed, 12 insertions, 1 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 2e6ac3d839..b2beac391b 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -355,7 +355,7 @@ class Command(NoArgsCommand): norm_patterns.append(p) all_files = [] - ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings.STATIC_ROOT)] + ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings.STATIC_ROOT) if p] for dirpath, dirnames, filenames in os.walk(force_text(root), topdown=True, followlinks=self.symlinks): for dirname in dirnames[:]: if (is_ignored(os.path.normpath(os.path.join(dirpath, dirname)), norm_patterns) or diff --git a/docs/releases/1.7.2.txt b/docs/releases/1.7.2.txt index 7a744bf70c..a28a86d551 100644 --- a/docs/releases/1.7.2.txt +++ b/docs/releases/1.7.2.txt @@ -21,3 +21,6 @@ Bugfixes * Prevented :djadmin:`flush` from loading initial data for migrated apps (:ticket:`23699`). + +* Fixed a :djadmin:`makemessages` regression in 1.7.1 when + :setting:`STATIC_ROOT` has the default ``None`` value (:ticket:`23717`). diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index e0d3b51eb0..4cff6de66a 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -358,6 +358,14 @@ class JavascriptExtractorTests(ExtractorTests): self.assertMsgId("Static content inside app should be included.", po_contents) self.assertNotMsgId("Content from STATIC_ROOT should not be included", po_contents) + @override_settings(STATIC_ROOT=None, MEDIA_ROOT='') + def test_default_root_settings(self): + """ + Regression test for #23717. + """ + _, po_contents = self._run_makemessages(domain='djangojs') + self.assertMsgId("Static content inside app should be included.", po_contents) + class IgnoredExtractorTests(ExtractorTests): |
