Simplified verbose_name_raw property

This commit is contained in:
Claude Paroz 2015-01-08 15:04:16 +01:00
parent ade9859996
commit de4bfb3fad
1 changed files with 3 additions and 6 deletions

View File

@ -18,7 +18,7 @@ from django.utils.encoding import force_text, smart_text, python_2_unicode_compa
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.lru_cache import lru_cache from django.utils.lru_cache import lru_cache
from django.utils.text import camel_case_to_spaces from django.utils.text import camel_case_to_spaces
from django.utils.translation import activate, deactivate_all, get_language, string_concat from django.utils.translation import override, string_concat
EMPTY_RELATION_TREE = tuple() EMPTY_RELATION_TREE = tuple()
@ -339,11 +339,8 @@ class Options(object):
(so that we get the same value regardless of currently active (so that we get the same value regardless of currently active
locale). locale).
""" """
lang = get_language() with override(None):
deactivate_all() return force_text(self.verbose_name)
raw = force_text(self.verbose_name)
activate(lang)
return raw
@property @property
def swapped(self): def swapped(self):