From f6aa8baf5230dc13403cb899471cf6a64cc5e500 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 16 Dec 2005 02:05:12 +0000 Subject: [PATCH] magic-removal: Changed django.core.management.validate to output 'Skipping validation' message if validation raises ImproperlyConfigured git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1682 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index 9a2f62cd82..460d67e06b 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -2,6 +2,7 @@ # development-server initialization. import django +from django.core.exceptions import ImproperlyConfigured import os, re, sys, textwrap from optparse import OptionParser @@ -742,8 +743,11 @@ def get_validation_errors(outfile): def validate(outfile=sys.stdout): "Validates all installed models." - num_errors = get_validation_errors(outfile) - outfile.write('%s error%s found.\n' % (num_errors, num_errors != 1 and 's' or '')) + try: + num_errors = get_validation_errors(outfile) + outfile.write('%s error%s found.\n' % (num_errors, num_errors != 1 and 's' or '')) + except ImproperlyConfigured: + outfile.write("Skipping validation because things aren't configured properly.") validate.args = '' def runserver(addr, port):