From c177d0690e08628ccb83b021d413ff461f7d6002 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 21 Aug 2015 14:09:29 +0200 Subject: [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. --- django/utils/translation/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'django/utils') 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) -- cgit v1.3