Merge branch 'dev'

This commit is contained in:
shamoon
2024-10-29 11:08:50 -07:00
14 changed files with 52 additions and 40 deletions

View File

@@ -24,7 +24,6 @@ from django.utils import timezone
from filelock import FileLock
from guardian.models import GroupObjectPermission
from guardian.models import UserObjectPermission
from rest_framework.authtoken.models import Token
if TYPE_CHECKING:
from django.db.models import QuerySet
@@ -271,7 +270,6 @@ class Command(CryptMixin, BaseCommand):
"social_accounts": SocialAccount.objects.all(),
"social_apps": SocialApp.objects.all(),
"social_tokens": SocialToken.objects.all(),
"auth_tokens": Token.objects.all(),
}
if settings.AUDIT_LOG_ENABLED:
@@ -570,11 +568,7 @@ class Command(CryptMixin, BaseCommand):
value=manifest_record["fields"][field],
)
elif (
MailAccount.objects.count() > 0
or SocialToken.objects.count() > 0
or Token.objects.count() > 0
):
elif MailAccount.objects.count() > 0 or SocialToken.objects.count() > 0:
self.stdout.write(
self.style.NOTICE(
"No passphrase was given, sensitive fields will be in plaintext",

View File

@@ -108,13 +108,6 @@ class CryptMixin:
"token_secret",
],
},
{
"exporter_key": "auth_tokens",
"model_name": "authtoken.token",
"fields": [
"key",
],
},
]
def get_crypt_params(self) -> dict[str, dict[str, str | int]]:

View File

@@ -8,6 +8,9 @@ from pathlib import Path
from unittest import mock
from zipfile import ZipFile
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.models import SocialApp
from allauth.socialaccount.models import SocialToken
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
@@ -874,6 +877,23 @@ class TestCryptExportImport(
password="mypassword",
)
app = SocialApp.objects.create(
provider="test",
name="test",
client_id="test",
)
account = SocialAccount.objects.create(
user=User.objects.first(),
provider="test",
uid="test",
)
SocialToken.objects.create(
app=app,
account=account,
token="test",
token_secret="test",
)
call_command(
"document_exporter",
"--no-progress-bar",
@@ -912,6 +932,9 @@ class TestCryptExportImport(
self.assertIsNotNone(account)
self.assertEqual(account.password, "mypassword")
social_token = SocialToken.objects.first()
self.assertIsNotNone(social_token)
def test_import_crypt_no_passphrase(self):
"""
GIVEN:

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-22 00:30\n"
"PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n"
"Language-Team: Catalan\n"
"Language: ca_ES\n"

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-25 12:12\n"
"PO-Revision-Date: 2024-10-29 00:31\n"
"Last-Translator: \n"
"Language-Team: French\n"
"Language: fr_FR\n"

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-20 05:58\n"
"PO-Revision-Date: 2024-10-29 18:05\n"
"Last-Translator: \n"
"Language-Team: Italian\n"
"Language: it_IT\n"

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-26 12:11\n"
"PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n"
"Language-Team: Polish\n"
"Language: pl_PL\n"
@@ -23,7 +23,7 @@ msgstr "Dokumenty"
#: documents/filters.py:334
msgid "Value must be valid JSON."
msgstr ""
msgstr "Wartość musi być prawidłowym JSON."
#: documents/filters.py:353
msgid "Invalid custom field query expression"

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-24 12:12\n"
"PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Language: zh_CN\n"