mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-24 07:18:11 +01:00
Chore: switch from os.path to pathlib.Path (#9060)
This commit is contained in:
parent
aaaa6c1393
commit
76d363f22d
17 changed files with 89 additions and 150 deletions
|
|
@ -38,9 +38,9 @@ class TestChecks(DirectoriesMixin, TestCase):
|
|||
self.assertTrue(msg.msg.endswith("is set but doesn't exist."))
|
||||
|
||||
def test_paths_check_no_access(self):
|
||||
os.chmod(self.dirs.data_dir, 0o000)
|
||||
os.chmod(self.dirs.media_dir, 0o000)
|
||||
os.chmod(self.dirs.consumption_dir, 0o000)
|
||||
Path(self.dirs.data_dir).chmod(0o000)
|
||||
Path(self.dirs.media_dir).chmod(0o000)
|
||||
Path(self.dirs.consumption_dir).chmod(0o000)
|
||||
|
||||
self.addCleanup(os.chmod, self.dirs.data_dir, 0o777)
|
||||
self.addCleanup(os.chmod, self.dirs.media_dir, 0o777)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from allauth.account import views as allauth_account_views
|
||||
from allauth.mfa.base import views as allauth_mfa_views
|
||||
|
|
@ -270,7 +270,7 @@ urlpatterns = [
|
|||
re_path(
|
||||
r"^logo(?P<path>.*)$",
|
||||
serve,
|
||||
kwargs={"document_root": os.path.join(settings.MEDIA_ROOT, "logo")},
|
||||
kwargs={"document_root": Path(settings.MEDIA_ROOT) / "logo"},
|
||||
),
|
||||
# allauth
|
||||
path(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue