Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tmp sync mobile dir
Browse files Browse the repository at this point in the history
submarcos committed Nov 4, 2024
1 parent 191f866 commit ed7a5a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geotrek/api/management/commands/sync_mobile.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
from zipfile import ZipFile

import cairosvg
from PIL import Image
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.management.base import BaseCommand, CommandError
@@ -19,7 +20,6 @@
from django.utils import translation
from django.utils.translation import gettext as _
from modeltranslation.utils import build_localized_fieldname
from PIL import Image

from geotrek.api.mobile.views.common import FlatPageViewSet, SettingsView
from geotrek.api.mobile.views.trekking import TrekViewSet
@@ -538,7 +538,7 @@ def handle(self, *args, **options):
'ignore_errors': True,
'tiles_dir': settings.MOBILE_TILES_PATH,
}
sync_mobile_tmp_dir = os.path.join(settings.TMP_DIR, 'sync_mobile')
sync_mobile_tmp_dir = tempfile.TemporaryDirectory(dir=settings.TMP_DIR).name
if options['empty_tmp_folder']:
for dir in os.listdir(sync_mobile_tmp_dir):
shutil.rmtree(os.path.join(sync_mobile_tmp_dir, dir))

0 comments on commit ed7a5a7

Please sign in to comment.