fix package.tar file path generation with pathlib
This commit is contained in:
parent
73c80f576c
commit
c8ec578045
1 changed files with 3 additions and 2 deletions
5
src/c3nav/mapdata/utils/cache/package.py
vendored
5
src/c3nav/mapdata/utils/cache/package.py
vendored
|
@ -21,9 +21,10 @@ class CachePackage:
|
||||||
def save(self, filename=None, compression=None):
|
def save(self, filename=None, compression=None):
|
||||||
if filename is None:
|
if filename is None:
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
filename = settings.CACHE_ROOT / 'package.tar'
|
|
||||||
if compression is not None:
|
if compression is not None:
|
||||||
filename += '.' + compression
|
filename = settings.CACHE_ROOT / f'package.tar.{compression}'
|
||||||
|
else:
|
||||||
|
filename = settings.CACHE_ROOT / 'package.tar'
|
||||||
|
|
||||||
filemode = 'w'
|
filemode = 'w'
|
||||||
if compression is not None:
|
if compression is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue