Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed unneeded smart_str in generic views.

  • Loading branch information...
commit 2042f537a6d7d67bdf65ca322aad1c6124e07527 1 parent 8c72aa2
@claudep claudep authored
Showing with 2 additions and 4 deletions.
  1. +1 −2  django/views/generic/detail.py
  2. +1 −2  django/views/generic/list.py
View
3  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 @@ def get_context_object_name(self, obj):
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
View
3  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 @@ def get_context_object_name(self, object_list):
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
Please sign in to comment.
Something went wrong with that request. Please try again.