Fixes: 1) Correct default manager assignment in `Product` model; 2) Address potential division by zero in `AbsoluteFTPStorage`; 3) Ensure proper exception handling for missing `order` attributes in CRM gateway methods; 4) Rectify inaccurate string formatting for `Transaction` `__str__` method. Extra: Refactor various minor code style issues, including formatting corrections in the README, alignment in the emailing utility, and suppressed pycharm-specific inspections; clean up unused imports across files; enhance error messaging consistency.
14 lines
382 B
Python
14 lines
382 B
Python
from urllib.parse import urlparse
|
|
|
|
from storages.backends.ftp import FTPStorage
|
|
|
|
|
|
class AbsoluteFTPStorage(FTPStorage): # type: ignore
|
|
# noinspection PyProtectedMember
|
|
# noinspection PyUnresolvedReferences
|
|
|
|
def _get_config(self):
|
|
cfg = super()._get_config()
|
|
url = urlparse(self.location)
|
|
cfg["path"] = url.path or cfg["path"]
|
|
return cfg
|