diff options
author | Karen Tracey <kmtracey@gmail.com> | 2011-05-22 15:51:22 +0000 |
---|---|---|
committer | Karen Tracey <kmtracey@gmail.com> | 2011-05-22 15:51:22 +0000 |
commit | 909e002808135ee943643e6b1866e9aa5cb0b42d (patch) | |
tree | b99258a70edcb62f79254e5b06a471da11213c59 /django | |
parent | d95355b6db0a457130bce22bb1dbf1a48731dfc6 (diff) | |
download | django-909e002808135ee943643e6b1866e9aa5cb0b42d.tar.gz |
Fix UnboundLocalError than could occur during ModelAdmin validation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16262 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r-- | django/contrib/admin/validation.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/validation.py b/django/contrib/admin/validation.py index b4f2b9d0dc..33acebf0b6 100644 --- a/django/contrib/admin/validation.py +++ b/django/contrib/admin/validation.py @@ -247,9 +247,9 @@ def validate_fields_spec(cls, model, opts, flds, label): try: f = opts.get_field(field) except models.FieldDoesNotExist: - # If we can't find a field on the model that matches, - # it could be an extra field on the form. - pass + # If we can't find a field on the model that matches, it could be an + # extra field on the form; nothing to check so move on to the next field. + continue if isinstance(f, models.ManyToManyField) and not f.rel.through._meta.auto_created: raise ImproperlyConfigured("'%s.%s' " "can't include the ManyToManyField field '%s' because " |