mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Chore: switch from os.path to pathlib.Path (#9060)
This commit is contained in:

committed by
GitHub

parent
aaaa6c1393
commit
76d363f22d
@@ -315,7 +315,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
||||
|
||||
@property
|
||||
def source_file(self):
|
||||
return open(self.source_path, "rb")
|
||||
return Path(self.source_path).open("rb")
|
||||
|
||||
@property
|
||||
def has_archive_version(self) -> bool:
|
||||
@@ -330,7 +330,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
||||
|
||||
@property
|
||||
def archive_file(self):
|
||||
return open(self.archive_path, "rb")
|
||||
return Path(self.archive_path).open("rb")
|
||||
|
||||
def get_public_filename(self, *, archive=False, counter=0, suffix=None) -> str:
|
||||
"""
|
||||
@@ -367,7 +367,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
||||
|
||||
@property
|
||||
def thumbnail_file(self):
|
||||
return open(self.thumbnail_path, "rb")
|
||||
return Path(self.thumbnail_path).open("rb")
|
||||
|
||||
@property
|
||||
def created_date(self):
|
||||
|
Reference in New Issue
Block a user