mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.6.x] Fixed #21551 -- Reenabled loading fixtures from subdirectory
This was a regression in Django 1.6 that was only partially restored in839940f27f. Thanks Jonas Haag for the report. Backport of41ebc4838dfrom master.
This commit is contained in:
		| @@ -175,11 +175,15 @@ class Command(BaseCommand): | ||||
|         if self.verbosity >= 2: | ||||
|             self.stdout.write("Loading '%s' fixtures..." % fixture_name) | ||||
|  | ||||
|         if os.path.sep in fixture_name: | ||||
|         if os.path.isabs(fixture_name): | ||||
|             fixture_dirs = [os.path.dirname(fixture_name)] | ||||
|             fixture_name = os.path.basename(fixture_name) | ||||
|         else: | ||||
|             fixture_dirs = self.fixture_dirs | ||||
|             if os.path.sep in fixture_name: | ||||
|                 fixture_dirs = [os.path.join(dir_, os.path.dirname(fixture_name)) | ||||
|                                 for dir_ in fixture_dirs] | ||||
|                 fixture_name = os.path.basename(fixture_name) | ||||
|  | ||||
|         suffixes = ('.'.join(ext for ext in combo if ext) | ||||
|                 for combo in product(databases, ser_fmts, cmp_fmts)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user