From 2042f537a6d7d67bdf65ca322aad1c6124e07527 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 24 May 2012 23:55:39 +0200 Subject: [PATCH] Removed unneeded smart_str in generic views. --- django/views/generic/detail.py | 3 +-- django/views/generic/list.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/django/views/generic/detail.py b/django/views/generic/detail.py index d4fb37124df..4b5281745e0 100644 --- a/django/views/generic/detail.py +++ b/django/views/generic/detail.py @@ -1,6 +1,5 @@ from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404 -from django.utils.encoding import smart_str from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateResponseMixin, ContextMixin, View @@ -81,7 +80,7 @@ class SingleObjectMixin(ContextMixin): if self.context_object_name: return self.context_object_name elif hasattr(obj, '_meta'): - return smart_str(obj._meta.object_name.lower()) + return obj._meta.object_name.lower() else: return None diff --git a/django/views/generic/list.py b/django/views/generic/list.py index 9f6e0e130c6..ae45fd2218c 100644 --- a/django/views/generic/list.py +++ b/django/views/generic/list.py @@ -1,7 +1,6 @@ from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ImproperlyConfigured from django.http import Http404 -from django.utils.encoding import smart_str from django.utils.translation import ugettext as _ from django.views.generic.base import TemplateResponseMixin, ContextMixin, View @@ -77,7 +76,7 @@ class MultipleObjectMixin(ContextMixin): if self.context_object_name: return self.context_object_name elif hasattr(object_list, 'model'): - return smart_str('%s_list' % object_list.model._meta.object_name.lower()) + return '%s_list' % object_list.model._meta.object_name.lower() else: return None