misc: correctly reset current directory after translations (#36331)

This commit is contained in:
Frédéric Péters 2019-09-22 13:07:58 +02:00
parent 9a31e83d10
commit 56b133c7a7
1 changed files with 3 additions and 2 deletions

View File

@ -71,17 +71,18 @@ class compile_translations(Command):
pass
def run(self):
curdir = os.getcwd()
try:
from django.core.management import call_command
for path, dirs, files in os.walk('chrono'):
if 'locale' not in dirs:
continue
curdir = os.getcwd()
os.chdir(os.path.realpath(path))
call_command('compilemessages')
os.chdir(curdir)
except ImportError:
sys.stderr.write('!!! Please install Django >= 1.4 to build translations\n')
finally:
os.chdir(curdir)
class compile_scss(Command):