Compare commits

...

17 Commits

Author SHA1 Message Date
shamoon 01421ce89a Fix: clamp mailrule max age before migration 2026-07-05 12:22:57 -07:00
shamoon 1dabd2601d Fix: handle relative date with comma query (#13087) 2026-07-03 12:44:33 -07:00
shamoon 88f69841b3 Merge branch 'dev' into beta 2026-07-02 15:06:19 -07:00
GitHub Actions 8ad321b743 Auto translate strings 2026-07-02 22:03:59 +00:00
dependabot[bot] ea1102b7f2 Chore(deps): Bump pdfjs-dist from 5.7.284 to 6.0.227 in /src-ui (#13080)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 22:02:20 +00:00
dependabot[bot] 627875b1cf Chore(deps-dev): Bump @playwright/test from 1.60.0 to 1.61.1 in /src-ui (#13078)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 08:25:57 -07:00
dependabot[bot] 7ffaba6aac Chore(deps-dev): Bump the frontend-eslint-dependencies group in /src-ui with 4 updates (#13076)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 15:23:09 +00:00
dependabot[bot] fe81f3ee98 Chore(deps): Bump uuid from 14.0.0 to 14.0.1 in /src-ui (#13077)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 15:07:48 +00:00
dependabot[bot] ed9372c808 Chore(deps-dev): Bump jest-preset-angular from 16.1.5 to 17.0.0 in /src-ui in the frontend-jest-dependencies group (#13075)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 14:50:59 +00:00
dependabot[bot] b804da0140 Chore(deps-dev): Bump @types/node from 25.9.1 to 26.0.0 in /src-ui (#13081)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-02 07:30:21 -07:00
shamoon 5b8fbdcec7 Merge branch 'dev' into beta 2026-06-27 15:56:20 -07:00
NgoQuocViet2001 67972a0740 Fix (beta): fix sanity checker affected document counts (#13052)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-06-27 15:55:38 -07:00
shamoon beb048b94a Merge branch 'dev' into beta 2026-06-27 06:53:09 -07:00
shamoon a8bfa25efd Fix (beta): preserve Unicode in localization prompt (#13055) 2026-06-27 05:53:36 -07:00
shamoon 00baacb26c Update SECURITY.md to clarify design choice 2026-06-23 23:37:55 -07:00
shamoon b33d11778a Fix: change tantivy token limit to title field max length (#13046) 2026-06-23 08:02:26 -07:00
GitHub Actions 63c19e7f75 Auto translate strings 2026-06-23 14:34:24 +00:00
22 changed files with 969 additions and 779 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ jobs:
runs-on: ubuntu-24.04
permissions:
contents: read
container: mcr.microsoft.com/playwright:v1.60.0-noble
container: mcr.microsoft.com/playwright:v1.61.1-noble
env:
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
+1
View File
@@ -63,6 +63,7 @@ The following are not generally considered vulnerabilities unless accompanied by
- optional webhook, mail, AI, OCR, or integration behavior described without a product-level vulnerability
- missing limits or hardening settings presented without concrete impact
- generic AI or static-analysis output that is not confirmed against the current codebase and a real deployment scenario
- the ability to attach objects that a user cannot access to a document by ID is an intentional design choice, and not considered a vulnerability
## Transparency
+8
View File
@@ -326,3 +326,11 @@ behind a reverse proxy may need to set
[`PAPERLESS_TRUSTED_PROXIES`](configuration.md#PAPERLESS_TRUSTED_PROXIES),
[`PAPERLESS_ALLAUTH_TRUSTED_CLIENT_IP_HEADER`](configuration.md#PAPERLESS_ALLAUTH_TRUSTED_CLIENT_IP_HEADER),
or both, to avoid `403 Forbidden` errors on login.
## Database Migrations
Some integer fields have been changed to smaller types to reduce database size. If you have any `MailRule` records with a `maximum_age` greater than 32767, they will be clamped to 32767 during the migration to avoid errors during migration.
### Action Required
No user action is required. The migration will automatically clamp any `MailRule.maximum_age` values greater than 32767 to 32767 during the migration process.
+180 -137
View File
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -33,11 +33,11 @@
"ngx-device-detector": "^11.0.0",
"ngx-ui-tour-ng-bootstrap": "^18.0.0",
"normalize-diacritics": "^5.0.0",
"pdfjs-dist": "^5.7.284",
"pdfjs-dist": "^6.0.227",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"utif": "^3.1.0",
"uuid": "^14.0.0",
"uuid": "^14.0.1",
"zone.js": "^0.16.2"
},
"devDependencies": {
@@ -54,17 +54,17 @@
"@angular/cli": "~21.2.12",
"@angular/compiler-cli": "~21.2.14",
"@codecov/webpack-plugin": "^2.0.1",
"@playwright/test": "^1.60.0",
"@playwright/test": "^1.61.1",
"@types/jest": "^30.0.0",
"@types/node": "^25.9.1",
"@typescript-eslint/eslint-plugin": "^8.60.0",
"@typescript-eslint/parser": "^8.60.0",
"@typescript-eslint/utils": "^8.60.0",
"eslint": "^10.4.0",
"@types/node": "^26.0.0",
"@typescript-eslint/eslint-plugin": "^8.62.0",
"@typescript-eslint/parser": "^8.62.0",
"@typescript-eslint/utils": "^8.62.0",
"eslint": "^10.5.0",
"jest": "30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jest-junit": "^17.0.0",
"jest-preset-angular": "^16.1.5",
"jest-preset-angular": "^17.0.0",
"jest-websocket-mock": "^2.5.0",
"prettier-plugin-organize-imports": "^4.3.0",
"ts-node": "~10.9.1",
+531 -535
View File
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,6 @@ import {
} from 'pdfjs-dist/web/pdf_viewer.mjs'
import {
PdfRenderMode,
PdfSource,
PdfZoomLevel,
PdfZoomScale,
PngxPdfDocumentProxy,
@@ -43,7 +42,8 @@ export class PngxPdfViewerComponent
{
private readonly document = inject<Document>(DOCUMENT)
@Input() src!: PdfSource
@Input() src!: string
@Input() password?: string
@Input() page?: number
@Output() pageChange = new EventEmitter<number>()
@Input() rotation?: number
@@ -93,7 +93,7 @@ export class PngxPdfViewerComponent
}
ngOnChanges(changes: SimpleChanges): void {
if (changes['src']) {
if (changes['src'] || changes['password']) {
this.resetViewerState()
if (this.src) {
this.loadDocument()
@@ -174,8 +174,12 @@ export class PngxPdfViewerComponent
'assets/js/pdf.worker.min.mjs',
this.document.baseURI
).toString()
this.loadingTask = getDocument(this.src)
let initOptions = {
url: this.src,
password: this.password,
withCredentials: true,
}
this.loadingTask = getDocument(initOptions)
try {
const pdf = await this.loadingTask.promise
this.pdf = pdf
@@ -2,8 +2,6 @@ export type PngxPdfDocumentProxy = {
numPages: number
}
export type PdfSource = string | { url: string; password?: string }
export enum PdfRenderMode {
Single = 'single',
All = 'all',
@@ -473,6 +473,7 @@
<div class="preview-sticky pdf-viewer-container">
<pngx-pdf-viewer
[src]="pdfSource"
[password]="pdfPassword"
[renderMode]="PdfRenderMode.All"
[(page)]="previewCurrentPage"
[zoomScale]="previewZoomScale"
@@ -1530,11 +1530,13 @@ describe('DocumentDetailComponent', () => {
})
it('should clear pdf source if preview URL is empty', () => {
component.pdfSource = { url: '/preview', password: 'secret' } as any
component.pdfSource = '/preview'
component.pdfPassword = 'secret'
component.previewUrl = null
;(component as any).updatePdfSource()
expect(component.pdfSource).toEqual({ url: null, password: undefined })
expect(component.pdfSource).toEqual(null)
expect(component.pdfPassword).toBeUndefined()
})
it('should close incoming update modal if one is open', () => {
@@ -1871,9 +1873,8 @@ describe('DocumentDetailComponent', () => {
expect(component.thumbUrl).toBe('thumb-version')
expect(component.previewText).toBe('version text')
expect(component.documentForm.get('content').value).toBe('version-content')
const pdfSource = component.pdfSource as { url: string; password?: string }
expect(pdfSource.url).toBe('preview-version')
expect(pdfSource.password).toBeUndefined()
expect(component.pdfSource).toBe('preview-version')
expect(component.pdfPassword).toBeUndefined()
previewSpy.mockReturnValueOnce('preview-error')
component.selectVersion(11)
@@ -115,7 +115,6 @@ import { PDFEditorComponent } from '../common/pdf-editor/pdf-editor.component'
import { PngxPdfViewerComponent } from '../common/pdf-viewer/pdf-viewer.component'
import {
PdfRenderMode,
PdfSource,
PdfZoomLevel,
PdfZoomScale,
PngxPdfDocumentProxy,
@@ -242,7 +241,8 @@ export class DocumentDetailComponent
title: string
titleSubject: Subject<string> = new Subject()
previewUrl: string
pdfSource?: PdfSource
pdfSource?: string
pdfPassword?: string
thumbUrl: string
previewText: string
previewLoaded: boolean = false
@@ -375,10 +375,8 @@ export class DocumentDetailComponent
}
private updatePdfSource() {
this.pdfSource = {
url: this.previewUrl,
password: this.password,
}
this.pdfSource = this.previewUrl
this.pdfPassword = this.password
}
private loadMetadataForSelectedVersion() {
+29 -8
View File
@@ -45,6 +45,12 @@ class SanityCheckMessages:
def __init__(self) -> None:
self._messages: dict[int | None, list[MessageEntry]] = defaultdict(list)
self._document_pks: set[int] = set()
self._document_error_pks: set[int] = set()
self._document_warning_pks: set[int] = set()
self._document_info_pks: set[int] = set()
self._document_error_issue_count: int = 0
self._document_warning_issue_count: int = 0
self.has_error: bool = False
self.has_warning: bool = False
self.has_info: bool = False
@@ -56,20 +62,33 @@ class SanityCheckMessages:
# -- Recording ----------------------------------------------------------
def _add_document_issue(self, doc_pk: int, document_pks: set[int]) -> bool:
if doc_pk not in self._document_pks:
self._document_pks.add(doc_pk)
self.document_count += 1
if doc_pk in document_pks:
return False
document_pks.add(doc_pk)
return True
def error(self, doc_pk: int | None, message: str) -> None:
self._messages[doc_pk].append({"level": logging.ERROR, "message": message})
self.has_error = True
if doc_pk is not None:
self.document_count += 1
self.document_error_count += 1
self._document_error_issue_count += 1
if self._add_document_issue(doc_pk, self._document_error_pks):
self.document_error_count += 1
def warning(self, doc_pk: int | None, message: str) -> None:
self._messages[doc_pk].append({"level": logging.WARNING, "message": message})
self.has_warning = True
if doc_pk is not None:
self.document_count += 1
self.document_warning_count += 1
self._document_warning_issue_count += 1
if self._add_document_issue(doc_pk, self._document_warning_pks):
self.document_warning_count += 1
else:
# This is the only type of global message we do right now
self.global_warning_count += 1
@@ -78,8 +97,10 @@ class SanityCheckMessages:
self._messages[doc_pk].append({"level": logging.INFO, "message": message})
self.has_info = True
if doc_pk is not None:
self.document_count += 1
if doc_pk is not None and self._add_document_issue(
doc_pk,
self._document_info_pks,
):
self.document_info_count += 1
# -- Iteration / query --------------------------------------------------
@@ -105,8 +126,8 @@ class SanityCheckMessages:
def total_issue_count(self) -> int:
"""Total number of error and warning messages across all documents and global."""
return (
self.document_error_count
+ self.document_warning_count
self._document_error_issue_count
+ self._document_warning_issue_count
+ self.global_warning_count
)
+7 -4
View File
@@ -48,6 +48,9 @@ _LANGUAGE_MAP: dict[str, str] = {
}
SUPPORTED_LANGUAGES: frozenset[str] = frozenset(_LANGUAGE_MAP)
# Document.title is max_length=128, so use 129 as the limit for
# Tantivy's remove_long filter
_TOKEN_REMOVE_LONG_LIMIT: Final[int] = 129
def register_tokenizers(index: tantivy.Index, language: str | None) -> None:
@@ -77,10 +80,10 @@ def register_tokenizers(index: tantivy.Index, language: str | None) -> None:
def _paperless_text(language: str | None) -> tantivy.TextAnalyzer:
"""Main full-text tokenizer for content, title, etc: simple -> remove_long(65) -> lowercase -> ascii_fold [-> stemmer]"""
"""Main full-text tokenizer for content, title, etc: simple -> remove_long(129) -> lowercase -> ascii_fold [-> stemmer]"""
builder = (
tantivy.TextAnalyzerBuilder(tantivy.Tokenizer.simple())
.filter(tantivy.Filter.remove_long(65))
.filter(tantivy.Filter.remove_long(_TOKEN_REMOVE_LONG_LIMIT))
.filter(tantivy.Filter.lowercase())
.filter(tantivy.Filter.ascii_fold())
)
@@ -119,12 +122,12 @@ def _bigram_analyzer() -> tantivy.TextAnalyzer:
def _simple_search_analyzer() -> tantivy.TextAnalyzer:
"""Tokenizer for simple substring search fields: non-whitespace chunks -> remove_long(65) -> lowercase -> ascii_fold."""
"""Tokenizer for simple substring search fields: non-whitespace chunks -> remove_long(129) -> lowercase -> ascii_fold."""
return (
tantivy.TextAnalyzerBuilder(
tantivy.Tokenizer.regex(r"\S+"),
)
.filter(tantivy.Filter.remove_long(65))
.filter(tantivy.Filter.remove_long(_TOKEN_REMOVE_LONG_LIMIT))
.filter(tantivy.Filter.lowercase())
.filter(tantivy.Filter.ascii_fold())
.build()
+6 -1
View File
@@ -163,7 +163,12 @@ def scan(query: str) -> list[Token]:
i += 1
continue
token, i = matched
_flush(buf, tokens)
if buf and buf[-1] == ",":
buf.pop()
_flush(buf, tokens)
tokens.append(Comma())
else:
_flush(buf, tokens)
tokens.append(token)
i = _maybe_comma(query, i, tokens)
_flush(buf, tokens)
@@ -261,6 +261,36 @@ class TestSearch:
== 1
)
@pytest.mark.parametrize(
("search_mode", "query"),
[
pytest.param(SearchMode.TITLE, "12345", id="title_search"),
pytest.param(SearchMode.TEXT, "12345", id="text_search"),
pytest.param(SearchMode.QUERY, None, id="query_title_exact"),
],
)
def test_search_modes_match_model_limit_title_tokens(
self,
backend: TantivyBackend,
search_mode: SearchMode,
query: str | None,
) -> None:
"""Search must keep filename-like title tokens up to the model limit."""
long_title = "1234567890" * 12 + "12345678"
doc = Document.objects.create(
title=long_title,
content="ordinary content",
checksum="TXT12",
pk=18,
)
backend.add_or_update(doc)
assert backend.search_ids(
query or f"title:{long_title}",
user=None,
search_mode=search_mode,
) == [doc.pk]
@pytest.mark.parametrize(
("mode", "title", "content", "hits", "misses"),
[
@@ -99,6 +99,25 @@ class TestTokenizers:
)
assert simple_search_index.searcher().search(q, limit=5).count == 1
def test_simple_search_analyzer_supports_model_limit_token_substrings(
self,
simple_search_index: tantivy.Index,
) -> None:
"""Simple substring search keeps tokens up to Document.title's model limit."""
long_token = "abcdefghij" * 12 + "abcdefgh"
writer = simple_search_index.writer()
doc = tantivy.Document()
doc.add_text("simple_content", long_token)
writer.add_document(doc)
writer.commit()
simple_search_index.reload()
q = tantivy.Query.regex_query(
simple_search_index.schema,
"simple_content",
".*cdefg.*",
)
assert simple_search_index.searcher().search(q, limit=5).count == 1
def test_unsupported_language_logs_warning(self, caplog: LogCaptureFixture) -> None:
"""Unsupported language codes should log a warning and disable stemming gracefully."""
sb = tantivy.SchemaBuilder()
@@ -716,6 +716,12 @@ class TestISODatetimeBounds:
"added:[2026-05-01T00:00:00Z TO 2026-06-01T00:00:00Z]"
)
def test_translate_query_text_before_comma_separated_date_clause(self) -> None:
result = translate_query("schäfersee,created:previous year", UTC)
assert result == (
"schäfersee AND created:[2025-01-01T00:00:00Z TO 2026-01-01T00:00:00Z]"
)
def test_invalid_iso_datetime_raises(self) -> None:
# A token with "T" that is not valid ISO datetime -> raise.
with pytest.raises(InvalidDateQuery) as exc_info:
+21
View File
@@ -12,6 +12,7 @@ from typing import TYPE_CHECKING
import pytest
from documents.sanity_checker import SanityCheckMessages
from documents.sanity_checker import check_sanity
if TYPE_CHECKING:
@@ -21,6 +22,26 @@ if TYPE_CHECKING:
from documents.tests.conftest import PaperlessDirs
class TestSanityCheckMessages:
def test_document_counts_are_unique_per_severity(self) -> None:
messages = SanityCheckMessages()
messages.error(1, "first error")
messages.error(1, "second error")
messages.warning(1, "first warning")
messages.warning(1, "second warning")
messages.info(1, "first info")
messages.info(1, "second info")
messages.warning(None, "global warning")
assert messages.document_count == 1
assert messages.document_error_count == 1
assert messages.document_warning_count == 1
assert messages.document_info_count == 1
assert messages.global_warning_count == 1
assert messages.total_issue_count == 5
@pytest.mark.django_db
class TestCheckSanityNoDocuments:
"""Sanity checks against an empty archive."""
+73 -65
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-03 22:14+0000\n"
"POT-Creation-Date: 2026-06-23 14:33+0000\n"
"PO-Revision-Date: 2022-02-17 04:17\n"
"Last-Translator: \n"
"Language-Team: English\n"
@@ -21,39 +21,39 @@ msgstr ""
msgid "Documents"
msgstr ""
#: documents/filters.py:463
#: documents/filters.py:464
msgid "Value must be valid JSON."
msgstr ""
#: documents/filters.py:482
#: documents/filters.py:483
msgid "Invalid custom field query expression"
msgstr ""
#: documents/filters.py:492
#: documents/filters.py:493
msgid "Invalid expression list. Must be nonempty."
msgstr ""
#: documents/filters.py:513
#: documents/filters.py:514
msgid "Invalid logical operator {op!r}"
msgstr ""
#: documents/filters.py:527
#: documents/filters.py:528
msgid "Maximum number of query conditions exceeded."
msgstr ""
#: documents/filters.py:591
#: documents/filters.py:592
msgid "{name!r} is not a valid custom field."
msgstr ""
#: documents/filters.py:628
#: documents/filters.py:629
msgid "{data_type} does not support query expr {expr!r}."
msgstr ""
#: documents/filters.py:743 documents/models.py:136
#: documents/filters.py:744 documents/models.py:136
msgid "Maximum nesting depth exceeded."
msgstr ""
#: documents/filters.py:990
#: documents/filters.py:1052
msgid "Custom field not found"
msgstr ""
@@ -1351,49 +1351,49 @@ msgstr ""
msgid "workflow runs"
msgstr ""
#: documents/serialisers.py:463 documents/serialisers.py:815
#: documents/serialisers.py:2681 documents/views.py:295 documents/views.py:2468
#: documents/serialisers.py:503 documents/serialisers.py:855
#: documents/serialisers.py:2744 documents/views.py:297 documents/views.py:2482
#: paperless_mail/serialisers.py:155
msgid "Insufficient permissions."
msgstr ""
#: documents/serialisers.py:651
#: documents/serialisers.py:691
msgid "Invalid color."
msgstr ""
#: documents/serialisers.py:2175
#: documents/serialisers.py:2216
#, python-format
msgid "File type %(type)s not supported"
msgstr ""
#: documents/serialisers.py:2219
#: documents/serialisers.py:2260
#, python-format
msgid "Custom field id must be an integer: %(id)s"
msgstr ""
#: documents/serialisers.py:2226
#: documents/serialisers.py:2267
#, python-format
msgid "Custom field with id %(id)s does not exist"
msgstr ""
#: documents/serialisers.py:2243 documents/serialisers.py:2253
#: documents/serialisers.py:2284 documents/serialisers.py:2294
msgid ""
"Custom fields must be a list of integers or an object mapping ids to values."
msgstr ""
#: documents/serialisers.py:2248
#: documents/serialisers.py:2289
msgid "Some custom fields don't exist or were specified twice."
msgstr ""
#: documents/serialisers.py:2395
#: documents/serialisers.py:2436
msgid "Invalid variable detected."
msgstr ""
#: documents/serialisers.py:2737
#: documents/serialisers.py:2800
msgid "Duplicate document identifiers are not allowed."
msgstr ""
#: documents/serialisers.py:2767 documents/views.py:4345
#: documents/serialisers.py:2830 documents/views.py:4429
#, python-format
msgid "Documents not found: %(ids)s"
msgstr ""
@@ -1661,32 +1661,36 @@ msgstr ""
msgid "Unable to parse URI {value}"
msgstr ""
#: documents/views.py:288 documents/views.py:2465
#: documents/views.py:290 documents/views.py:2479
msgid "Invalid more_like_id"
msgstr ""
#: documents/views.py:1511
#: documents/views.py:1513
msgid "Invalid AI configuration."
msgstr ""
#: documents/views.py:2290 documents/views.py:2606
#: documents/views.py:1522
msgid "AI backend request timed out."
msgstr ""
#: documents/views.py:2304 documents/views.py:2625
msgid "Specify only one of text, title_search, query, or more_like_id."
msgstr ""
#: documents/views.py:4357
#: documents/views.py:4441
#, python-format
msgid "Insufficient permissions to share document %(id)s."
msgstr ""
#: documents/views.py:4403
#: documents/views.py:4487
msgid "Bundle is already being processed."
msgstr ""
#: documents/views.py:4463
#: documents/views.py:4547
msgid "The share link bundle is still being prepared. Please try again later."
msgstr ""
#: documents/views.py:4473
#: documents/views.py:4557
msgid "The share link bundle is unavailable."
msgstr ""
@@ -1935,154 +1939,158 @@ msgid "Sets the LLM output language"
msgstr ""
#: paperless/models.py:370
msgid "Sets the LLM timeout in seconds"
msgstr ""
#: paperless/models.py:376
msgid "paperless application settings"
msgstr ""
#: paperless/settings/__init__.py:539
#: paperless/settings/__init__.py:545
msgid "English (US)"
msgstr ""
#: paperless/settings/__init__.py:540
#: paperless/settings/__init__.py:546
msgid "Arabic"
msgstr ""
#: paperless/settings/__init__.py:541
#: paperless/settings/__init__.py:547
msgid "Afrikaans"
msgstr ""
#: paperless/settings/__init__.py:542
#: paperless/settings/__init__.py:548
msgid "Belarusian"
msgstr ""
#: paperless/settings/__init__.py:543
#: paperless/settings/__init__.py:549
msgid "Bulgarian"
msgstr ""
#: paperless/settings/__init__.py:544
#: paperless/settings/__init__.py:550
msgid "Catalan"
msgstr ""
#: paperless/settings/__init__.py:545
#: paperless/settings/__init__.py:551
msgid "Czech"
msgstr ""
#: paperless/settings/__init__.py:546
#: paperless/settings/__init__.py:552
msgid "Danish"
msgstr ""
#: paperless/settings/__init__.py:547
#: paperless/settings/__init__.py:553
msgid "German"
msgstr ""
#: paperless/settings/__init__.py:548
#: paperless/settings/__init__.py:554
msgid "Greek"
msgstr ""
#: paperless/settings/__init__.py:549
#: paperless/settings/__init__.py:555
msgid "English (GB)"
msgstr ""
#: paperless/settings/__init__.py:550
#: paperless/settings/__init__.py:556
msgid "Spanish"
msgstr ""
#: paperless/settings/__init__.py:551
#: paperless/settings/__init__.py:557
msgid "Persian"
msgstr ""
#: paperless/settings/__init__.py:552
#: paperless/settings/__init__.py:558
msgid "Finnish"
msgstr ""
#: paperless/settings/__init__.py:553
#: paperless/settings/__init__.py:559
msgid "French"
msgstr ""
#: paperless/settings/__init__.py:554
#: paperless/settings/__init__.py:560
msgid "Hungarian"
msgstr ""
#: paperless/settings/__init__.py:555
#: paperless/settings/__init__.py:561
msgid "Indonesian"
msgstr ""
#: paperless/settings/__init__.py:556
#: paperless/settings/__init__.py:562
msgid "Italian"
msgstr ""
#: paperless/settings/__init__.py:557
#: paperless/settings/__init__.py:563
msgid "Japanese"
msgstr ""
#: paperless/settings/__init__.py:558
#: paperless/settings/__init__.py:564
msgid "Korean"
msgstr ""
#: paperless/settings/__init__.py:559
#: paperless/settings/__init__.py:565
msgid "Luxembourgish"
msgstr ""
#: paperless/settings/__init__.py:560
#: paperless/settings/__init__.py:566
msgid "Norwegian"
msgstr ""
#: paperless/settings/__init__.py:561
#: paperless/settings/__init__.py:567
msgid "Dutch"
msgstr ""
#: paperless/settings/__init__.py:562
#: paperless/settings/__init__.py:568
msgid "Polish"
msgstr ""
#: paperless/settings/__init__.py:563
#: paperless/settings/__init__.py:569
msgid "Portuguese (Brazil)"
msgstr ""
#: paperless/settings/__init__.py:564
#: paperless/settings/__init__.py:570
msgid "Portuguese"
msgstr ""
#: paperless/settings/__init__.py:565
#: paperless/settings/__init__.py:571
msgid "Romanian"
msgstr ""
#: paperless/settings/__init__.py:566
#: paperless/settings/__init__.py:572
msgid "Russian"
msgstr ""
#: paperless/settings/__init__.py:567
#: paperless/settings/__init__.py:573
msgid "Slovak"
msgstr ""
#: paperless/settings/__init__.py:568
#: paperless/settings/__init__.py:574
msgid "Slovenian"
msgstr ""
#: paperless/settings/__init__.py:569
#: paperless/settings/__init__.py:575
msgid "Serbian"
msgstr ""
#: paperless/settings/__init__.py:570
#: paperless/settings/__init__.py:576
msgid "Swedish"
msgstr ""
#: paperless/settings/__init__.py:571
#: paperless/settings/__init__.py:577
msgid "Turkish"
msgstr ""
#: paperless/settings/__init__.py:572
#: paperless/settings/__init__.py:578
msgid "Ukrainian"
msgstr ""
#: paperless/settings/__init__.py:573
#: paperless/settings/__init__.py:579
msgid "Vietnamese"
msgstr ""
#: paperless/settings/__init__.py:574
#: paperless/settings/__init__.py:580
msgid "Chinese Simplified"
msgstr ""
#: paperless/settings/__init__.py:575
#: paperless/settings/__init__.py:581
msgid "Chinese Traditional"
msgstr ""
+1 -1
View File
@@ -87,7 +87,7 @@ def build_localization_prompt(suggestions: dict, output_language: str) -> str:
Return the same JSON schema with all fields present.
Suggestions:
{json.dumps(suggestions)}
{json.dumps(suggestions, ensure_ascii=False)}
""".strip()
@@ -239,6 +239,23 @@ def test_get_language_name_falls_back_to_language_code():
assert get_language_name("zz-zz") == "zz-zz"
def test_build_localization_prompt_preserves_unicode_characters():
prompt = build_localization_prompt(
{
"title": "Gebührenbescheid",
"tags": [],
"correspondents": [],
"document_types": [],
"storage_paths": [],
"dates": [],
},
output_language="de-de",
)
assert "Gebührenbescheid" in prompt
assert "\\u00fc" not in prompt
@patch("paperless_ai.ai_classifier.query_similar_documents")
def test_get_context_for_document(
mock_query_similar_documents,
@@ -4,6 +4,12 @@ from django.db import migrations
from django.db import models
def clamp_mailrule_maximum_age(apps, schema_editor):
# Clamp the maximum_age field of MailRule because of PositiveIntegerField --> PositiveSmallIntegerField
MailRule = apps.get_model("paperless_mail", "MailRule")
MailRule.objects.filter(maximum_age__gt=32767).update(maximum_age=32767)
class Migration(migrations.Migration):
dependencies = [
("paperless_mail", "0001_squashed"),
@@ -112,6 +118,10 @@ class Migration(migrations.Migration):
verbose_name="consumption scope",
),
),
migrations.RunPython(
clamp_mailrule_maximum_age,
migrations.RunPython.noop,
),
migrations.AlterField(
model_name="mailrule",
name="maximum_age",