mirror of https://github.com/django/django.git
Fixed #17947 -- Fixed language restore after management command even when exceptions occur. Thanks andrey@kostenko.name for the report and the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
782c1a770e
commit
8c54d7cf71
|
@ -247,8 +247,9 @@ class BaseCommand(object):
|
|||
else:
|
||||
self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e)))
|
||||
sys.exit(1)
|
||||
if saved_lang is not None:
|
||||
translation.activate(saved_lang)
|
||||
finally:
|
||||
if saved_lang is not None:
|
||||
translation.activate(saved_lang)
|
||||
|
||||
def validate(self, app=None, display_num_errors=False):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue