Skip to content

Commit

Permalink
Simplified verbose_name_raw property
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Jan 8, 2015
1 parent ade9859 commit de4bfb3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions django/db/models/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from django.utils.functional import cached_property
from django.utils.lru_cache import lru_cache
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()

Expand Down Expand Up @@ -339,11 +339,8 @@ def verbose_name_raw(self):
(so that we get the same value regardless of currently active
locale).
"""
lang = get_language()
deactivate_all()
raw = force_text(self.verbose_name)
activate(lang)
return raw
with override(None):
return force_text(self.verbose_name)

@property
def swapped(self):
Expand Down

0 comments on commit de4bfb3

Please sign in to comment.