diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-08-21 14:09:29 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-08-25 10:37:54 +0200 |
| commit | c177d0690e08628ccb83b021d413ff461f7d6002 (patch) | |
| tree | 94ef83e3382f3d146bd0d53c01bbcb17e8fef693 /django/utils | |
| parent | 181528726ed2e3f1457e13872c777d0447cc52b8 (diff) | |
[1.8.x] Fixed #25295 -- Restored 'no active translation' after language override
Thanks David Nelson Adamec for the report and Tim Graham for the review.
Backport of 9324935c3 from master.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/translation/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py index 505d753268..a4c6963f0c 100644 --- a/django/utils/translation/__init__.py +++ b/django/utils/translation/__init__.py @@ -163,7 +163,9 @@ class override(ContextDecorator): deactivate_all() def __exit__(self, exc_type, exc_value, traceback): - if self.deactivate: + if self.old_language is None: + deactivate_all() + elif self.deactivate: deactivate() else: activate(self.old_language) |
