Ticket #19017: mgmt.patch

File mgmt.patch, 621 bytes (added by andrey@…, 3 years ago)
  • django/core/management/base.py

    diff --git a/django/core/management/base.py b/django/core/management/base.py
    index db855e1..a9fc38c 100644
    a b class BaseCommand(object): 
    247247            else:
    248248                self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e)))
    249249            sys.exit(1)
    250         if saved_lang is not None:
    251             translation.activate(saved_lang)
     250        finally:
     251            if saved_lang is not None:
     252                translation.activate(saved_lang)
    252253
    253254    def validate(self, app=None, display_num_errors=False):
    254255        """
Back to Top