Fixes: (1) Removed all `# type: ignore` annotations across the codebase; (2) Fixed usage of Django Model methods by eliminating unnecessary `# type: ignore` directives; (3) Adjusted usage of functions like `get()` to align with method expectations, removing incorrect comments; Extra: (1) Deleted `pyrightconfig.json` as part of migration to a stricter type-checked environment; (2) Minor code cleanup, including formatting changes and refactoring import statements in adherence to PEP8 recommendations.
15 lines
396 B
Python
15 lines
396 B
Python
from typing import Any
|
|
from urllib.parse import urlparse
|
|
|
|
from storages.backends.ftp import FTPStorage
|
|
|
|
|
|
class AbsoluteFTPStorage(FTPStorage):
|
|
# noinspection PyProtectedMember
|
|
# noinspection PyUnresolvedReferences
|
|
|
|
def _get_config(self) -> Any:
|
|
cfg = super()._get_config()
|
|
url = urlparse(self.location)
|
|
cfg["path"] = url.path or cfg["path"]
|
|
return cfg
|