From dc2bfae1e57089675c76ae77fd6ecc38d976ccd9 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 29 Jul 2011 09:39:35 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20#16531=20--=20Fixed=20various=20instanc?= =?UTF-8?q?es=20of=20"undefined=20name"=20issues.=20Thanks,=20Bruno=20Reni?= =?UTF-8?q?=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@16557 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/backends/base.py | 2 +- django/db/models/fields/__init__.py | 2 +- django/views/debug.py | 3 ++- django/views/generic/dates.py | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/django/contrib/gis/db/backends/base.py b/django/contrib/gis/db/backends/base.py index 2a62d97abf..c8bb3d2f93 100644 --- a/django/contrib/gis/db/backends/base.py +++ b/django/contrib/gis/db/backends/base.py @@ -121,7 +121,7 @@ class BaseSpatialOperations(object): raise NotImplementedError('Aggregate support not implemented for this spatial backend.') def spatial_lookup_sql(self, lvalue, lookup_type, value, field): - raise NotImplmentedError + raise NotImplementedError # Routines for getting the OGC-compliant models. def geometry_columns(self): diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 4362c047c3..b786b7bf11 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -967,7 +967,7 @@ class GenericIPAddressField(Field): if value and ':' in value: try: return clean_ipv6_address(value, self.unpack_ipv4) - except ValidationError: + except exceptions.ValidationError: pass return value diff --git a/django/views/debug.py b/django/views/debug.py index 58d271b860..4cbe101b0f 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -5,6 +5,7 @@ import sys import types from django.conf import settings +from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from django.template import (Template, Context, TemplateDoesNotExist, @@ -79,7 +80,7 @@ def get_exception_reporter_filter(request): try: default_exception_reporter_filter = getattr(mod, classname)() except AttributeError: - raise exceptions.ImproperlyConfigured('Default exception reporter filter module "%s" does not define a "%s" class' % (modname, classname)) + raise ImproperlyConfigured('Default exception reporter filter module "%s" does not define a "%s" class' % (modname, classname)) if request: return getattr(request, 'exception_reporter_filter', default_exception_reporter_filter) else: diff --git a/django/views/generic/dates.py b/django/views/generic/dates.py index 128f71ced0..c10db3004d 100644 --- a/django/views/generic/dates.py +++ b/django/views/generic/dates.py @@ -210,9 +210,9 @@ class BaseDateListView(MultipleObjectMixin, DateMixin, View): date_list = queryset.dates(date_field, date_type)[::-1] if date_list is not None and not date_list and not allow_empty: - raise Http404(_(u"No %(verbose_name_plural)s available") % { - 'verbose_name_plural': force_unicode(qs.model._meta.verbose_name_plural) - }) + name = force_unicode(queryset.model._meta.verbose_name_plural) + raise Http404(_(u"No %(verbose_name_plural)s available") % + {'verbose_name_plural': name}) return date_list