fix package.tar file path generation with pathlib

This commit is contained in:
Gwendolyn 2023-12-03 23:06:46 +01:00
parent 73c80f576c
commit c8ec578045

View file

@ -21,9 +21,10 @@ class CachePackage:
def save(self, filename=None, compression=None):
if filename is None:
from django.conf import settings
filename = settings.CACHE_ROOT / 'package.tar'
if compression is not None:
filename += '.' + compression
filename = settings.CACHE_ROOT / f'package.tar.{compression}'
else:
filename = settings.CACHE_ROOT / 'package.tar'
filemode = 'w'
if compression is not None: