A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Merge branch 'main' into dev
shamoon1b912c137a59
diff --cc src/paperless_mail/tests/test_api.pyindex dba8c840c,cbfe0f9a4..b5de98b50--- a/src/paperless_mail/tests/test_api.py+++ b/src/paperless_mail/tests/test_api.py@@@ -272,7 -272,25 +272,25 @@@ class TestAPIMailAccounts(DirectoriesMiself.assertEqual(response.status_code, status.HTTP_200_OK)self.assertEqual(response.data["success"], True)+ def test_mail_account_test_existing_nonexistent_id_forbidden(self):+ response = self.client.post(+ f"{self.ENDPOINT}test/",+ json.dumps(+ {+ "id": 999999,+ "imap_server": "server.example.com",+ "imap_port": 443,+ "imap_security": MailAccount.ImapSecurity.SSL,+ "username": "admin",+ "password": "******",+ },+ ),+ content_type="application/json",+ )+ self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)+ self.assertEqual(response.content.decode(), "Insufficient permissions")+- def test_get_mail_accounts_owner_aware(self):+ def test_get_mail_accounts_owner_aware(self) -> None:"""GIVEN:- Configured accounts with different usersdiff --cc src/paperless_mail/tests/test_mail.pyindex 4dffd677e,f8ab14bdd..fe45adbfd--- a/src/paperless_mail/tests/test_mail.py+++ b/src/paperless_mail/tests/test_mail.py@@@ -1850,9 -1820,57 +1855,57 @@@ class TestMailAccountTestView(APITestCaexpected_str = "Unable to refresh oauth token"self.assertIn(expected_str, error_str)+ def test_mail_account_test_view_existing_forbidden_for_other_owner(self):+ other_user = User.objects.create_user(+ username="otheruser",+ password="testpassword",+ )+ existing_account = MailAccount.objects.create(+ name="Owned account",+ imap_server="imap.example.com",+ imap_port=993,+ imap_security=MailAccount.ImapSecurity.SSL,+ username="admin",+ password="secret",+ owner=other_user,+ )+ data = {+ "id": existing_account.id,+ "imap_server": "imap.example.com",+ "imap_port": 993,+ "imap_security": MailAccount.ImapSecurity.SSL,+ "username": "admin",+ "password": "****",+ "is_token": False,+ }++ response = self.client.post(self.url, data, format="json")++ self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)+ self.assertEqual(response.content.decode(), "Insufficient permissions")++ def test_mail_account_test_view_requires_add_permission_without_account_id(self):+ self.user.user_permissions.remove(+ *Permission.objects.filter(codename__in=["add_mailaccount"]),+ )+ self.user.save()+ data = {+ "imap_server": "imap.example.com",+ "imap_port": 993,+ "imap_security": MailAccount.ImapSecurity.SSL,+ "username": "admin",+ "password": "secret",+ "is_token": False,+ }++ response = self.client.post(self.url, data, format="json")++ self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)+ self.assertEqual(response.content.decode(), "Insufficient permissions")+class TestMailAccountProcess(APITestCase):- def setUp(self):+ def setUp(self) -> None:self.mailMocker = MailMocker()self.mailMocker.setUp()self.user = User.objects.create_superuser(diff --cc uv.lockindex 07f521e19,87bb02b00..2b1ee98b1--- a/uv.lock+++ b/uv.lock@@@ -3019,10 -1991,9 +3019,10 @@@ wheels =[[package]]name = "paperless-ngx"- version = "2.20.7"+ version = "2.20.8"source = { virtual = "." }dependencies = [+ { name = "azure-ai-documentintelligence", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },{ name = "babel", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },{ name = "bleach", marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },{ name = "celery", extra = ["redis"], marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },