Chore: switch from os.path to pathlib.Path (#10539)

This commit is contained in:
Sebastian Steinbeißer 2025-09-03 17:12:41 +02:00 committed by GitHub
parent cc621cf729
commit d2064a2535
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 151 additions and 165 deletions

View file

@ -19,15 +19,15 @@ migration_1012_obj = importlib.import_module(
)
def archive_name_from_filename(filename):
return Path(filename).stem + ".pdf"
def archive_name_from_filename(filename: Path) -> Path:
return Path(filename.stem + ".pdf")
def archive_path_old(self):
def archive_path_old(self) -> Path:
if self.filename:
fname = archive_name_from_filename(self.filename)
fname = archive_name_from_filename(Path(self.filename))
else:
fname = f"{self.pk:07}.pdf"
fname = Path(f"{self.pk:07}.pdf")
return Path(settings.ARCHIVE_DIR) / fname