Skip to content

Commit

Permalink
Add flag to prevent wrong debug message (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
tb1337 authored May 22, 2024
1 parent 9fa6b69 commit 94a9316
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pypaperless/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ class HelperBase(PaperlessBase, Generic[ResourceT]):
"""Base class for all helpers in PyPaperless."""

_resource: PaperlessResource
_resource_public: bool = True

def __init__(self, api: "Paperless") -> None:
"""Initialize a `HelperBase` instance."""
super().__init__(api)

self._api.local_resources.add(self._resource)
if self._resource_public:
self._api.local_resources.add(self._resource)

@property
def is_available(self) -> bool:
Expand Down Expand Up @@ -72,6 +74,7 @@ class PaperlessModel(PaperlessBase):
def __init__(self, api: "Paperless", data: dict[str, Any]) -> None:
"""Initialize a `PaperlessModel` instance."""
super().__init__(api)

self._data = {}
self._data.update(data)
self._fetched = False
Expand Down
1 change: 1 addition & 0 deletions src/pypaperless/models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class StatusHelper(HelperBase[Status]):

_api_path = API_PATH["status"]
_resource = PaperlessResource.STATUS
_resource_public = False

_resource_cls = Status

Expand Down

0 comments on commit 94a9316

Please sign in to comment.