A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
fix writable check for NFS mounts
Robert57a5df1fce53
diff --git a/src/paperless/checks.py b/src/paperless/checks.pyindex df4d45e38..0d11d8a90 100644--- a/src/paperless/checks.py+++ b/src/paperless/checks.py@@ -1,5 +1,6 @@import osimport shutil+import statfrom django.conf import settingsfrom django.core.checks import Error, Warning, register@@ -16,16 +17,25 @@ writeable_hint = (def path_check(var, directory):messages = []if directory:- if not os.path.exists(directory):+ if not os.path.isdir(directory):messages.append(Error(exists_message.format(var),exists_hint.format(directory)))- elif not os.access(directory, os.W_OK | os.X_OK):- messages.append(Warning(- writeable_message.format(var),- writeable_hint.format(directory)- ))+ else:+ test_file = os.path.join(directory, '__paperless_write_test__')+ try:+ open(test_file, 'w')+ except PermissionError:+ messages.append(Error(+ writeable_message.format(var),+ writeable_hint.format(+ f'\n{stat.filemode(os.stat(directory).st_mode)} '+ f'{directory}\n')+ ))+ else:+ os.remove(test_file)+return messages