mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Merge branch 'dev' into feature-unified-search
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from django.conf import settings
|
||||
from django.contrib import auth
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
from rest_framework import authentication
|
||||
@@ -11,6 +12,7 @@ class AutoLoginMiddleware(MiddlewareMixin):
|
||||
try:
|
||||
request.user = User.objects.get(
|
||||
username=settings.AUTO_LOGIN_USERNAME)
|
||||
auth.login(request, request.user)
|
||||
except User.DoesNotExist:
|
||||
pass
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import shutil
|
||||
import stat
|
||||
|
||||
from django.conf import settings
|
||||
from 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
|
||||
|
||||
|
||||
|
@@ -303,7 +303,8 @@ LANGUAGES = [
|
||||
("pt-br", _("Portuguese (Brazil)")),
|
||||
("it-it", _("Italian")),
|
||||
("ro-ro", _("Romanian")),
|
||||
("ru-ru", _("Russian"))
|
||||
("ru-ru", _("Russian")),
|
||||
("es-es", _("Spanish"))
|
||||
]
|
||||
|
||||
LOCALE_PATHS = [
|
||||
|
@@ -1 +1 @@
|
||||
__version__ = (1, 3, 0)
|
||||
__version__ = (1, 3, 1)
|
||||
|
Reference in New Issue
Block a user