1
0
mirror of https://github.com/django/django.git synced 2025-03-14 03:10:45 +00:00

[1.7.x] Fixed #23717 -- Fixed makemessages crash when STATIC_ROOT=None

Backport of 528c9af54 from master.
This commit is contained in:
Claude Paroz 2014-10-27 09:35:01 +01:00
parent abee4f718e
commit 6a1bd837b1
3 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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`).

View File

@ -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):