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,6 +247,7 @@ class BaseCommand(object):
|
||||||
else:
|
else:
|
||||||
self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e)))
|
self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e)))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
finally:
|
||||||
if saved_lang is not None:
|
if saved_lang is not None:
|
||||||
translation.activate(saved_lang)
|
translation.activate(saved_lang)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue