[1.7.x] Only warn about initial data if fixtures have been found.

Backport of 2ab0ed7b28 from master.
This commit is contained in:
Florian Apolloner 2014-07-27 13:23:16 +02:00
parent df0d5ea7bc
commit f8ec200671
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ class Command(BaseCommand):
if fixture_name != 'initial_data' and not fixture_files: if fixture_name != 'initial_data' and not fixture_files:
# Warning kept for backwards-compatibility; why not an exception? # Warning kept for backwards-compatibility; why not an exception?
warnings.warn("No fixture named '%s' found." % fixture_name) warnings.warn("No fixture named '%s' found." % fixture_name)
elif fixture_name == 'initial_data': elif fixture_name == 'initial_data' and fixture_files:
warnings.warn( warnings.warn(
'initial_data fixtures are deprecated. Use data migrations instead.', 'initial_data fixtures are deprecated. Use data migrations instead.',
RemovedInDjango19Warning RemovedInDjango19Warning