mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-06-02 11:49:44 +00:00
Fix: get_parser factory forwards logging_group, drops progress_callback
consumer.py calls parser_class(logging_group, progress_callback=...). RemoteDocumentParser.__init__ accepts logging_group but not progress_callback, so only the latter is dropped — matching the pattern established by the TextDocumentParser signals shim. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,10 +3,15 @@ from __future__ import annotations
|
||||
from typing import Any
|
||||
|
||||
|
||||
def get_parser(logging_group: object = None) -> Any:
|
||||
def get_parser(*args: Any, **kwargs: Any) -> Any:
|
||||
from paperless.parsers.remote import RemoteDocumentParser
|
||||
|
||||
return RemoteDocumentParser(logging_group)
|
||||
# The new RemoteDocumentParser does not accept the progress_callback
|
||||
# kwarg injected by the old signal-based consumer. logging_group is
|
||||
# forwarded as a positional arg.
|
||||
# Phase 4 will replace this signal path with the new ParserRegistry.
|
||||
kwargs.pop("progress_callback", None)
|
||||
return RemoteDocumentParser(*args, **kwargs)
|
||||
|
||||
|
||||
def get_supported_mime_types() -> dict[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user