diff options
| author | Senko Rasic <senko.rasic@dobarkod.hr> | 2013-05-19 11:20:10 +0200 |
|---|---|---|
| committer | Senko Rasic <senko.rasic@dobarkod.hr> | 2013-05-19 11:31:27 +0200 |
| commit | c44a2c40fe0ed79b0fa00233a204d41e9c677750 (patch) | |
| tree | 28ffd80082bb94eb3299f059e960b56afaf96065 /django | |
| parent | cc3b3ba93a7bfdd2ece739e97e36150a719acd3e (diff) | |
Fixed #18990 -- Loaddata now complains if fixture doesn't exist
If the fixture doesn't exist, loaddata will output a warning.
The fixture named "initial_data" is exceptional though; if it
doesn't exist, the warning is not emitted. This allows syncdb and
flush management commands to attempt to load it without causing
spurious warnings.
Thanks to Derega, ptone, dirigeant and d1ffuz0r for contributions
to the ticket.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/loaddata.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index fbafed3f92..ab9f7468c4 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -4,6 +4,7 @@ import os import gzip import zipfile from optparse import make_option +import warnings from django.conf import settings from django.core import serializers @@ -169,7 +170,7 @@ class Command(BaseCommand): label_found = label_found or found if fixture_name != 'initial_data' and not label_found: - raise CommandError("No fixture named '%s' found." % fixture_name) + warnings.warn("No fixture named '%s' found." % fixture_name) def process_dir(self, fixture_dir, fixture_name, compression_formats, serialization_formats): |
