schon/evibes/ftpstorage.py
Egor fureunoir Gorbunov e373f28358 Features: 1) Introduced AbsoluteFTPStorage class for path customization in FTP storage; 2) Updated dbbackup settings to use AbsoluteFTPStorage for FTP storage configurations.
Fixes: 1) Corrected `DBBACKUP_PATH` default to ensure proper backup directory structure.

Extra: 1) Minor cleanup in FTP storage configuration handling.
2025-08-05 21:08:32 +03:00

11 lines
302 B
Python

from urllib.parse import urlparse
from storages.backends.ftp import FTPStorage
class AbsoluteFTPStorage(FTPStorage): # type: ignore
def _get_config(self):
cfg = super()._get_config()
url = urlparse(self.location)
cfg["path"] = url.path or cfg["path"]
return cfg