ragflow/api
shirukai fa7b857aa9
fix: resolve "'bool' object has no attribute 'items'" in SDK enabled … (#11725)
### What problem does this PR solve?
Fixes the `AttributeError: 'bool' object has no attribute 'items'` error
when updating the `enabled` parameter of a document via the Python SDK
(Issue #11721).

Background: When calling `Document.update({"enabled": True/False})`
through the SDK, the server-side API returned a boolean `data=True` in
the response (instead of a dictionary). The SDK's `_update_from_dict`
method (in `base.py`) expects a dictionary to iterate over with
`.items()`, leading to an immediate AttributeError during response
parsing. This prevented successful synchronization of the updated
`enabled` status to the local SDK object, even if the server-side
database/update index operations succeeded.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### Additional Context (optional, for clarity)
- **Root Cause**: Server returned `data=True` (boolean) for `enabled`
parameter updates, violating the SDK's expectation of a dictionary-type
`data` field.
- **Fix Logic**: 
1. Removed the separate `return get_result(data=True)` in the `enabled`
update branch to unify response flow.
  2. 
- **Backward Compatibility**: No breaking changes—other update scenarios
(e.g., renaming documents, modifying chunk methods) remain unaffected,
and the response format stays consistent.

Co-authored-by: shirukai <shirukai@hollysysdigital.com>
2025-12-04 11:24:01 +08:00
..
apps fix: resolve "'bool' object has no attribute 'items'" in SDK enabled … (#11725) 2025-12-04 11:24:01 +08:00
common Feat:admin api (#10642) 2025-10-18 16:09:48 +08:00
db Feat: RAG evaluation (#11674) 2025-12-03 17:00:58 +08:00
utils feat: Auto-disable Raptor for structured data (Issue #11653) (#11676) 2025-12-03 17:02:29 +08:00
__init__.py Fix: incorrect async chat streamly output (#11679) 2025-12-03 11:15:45 +08:00
constants.py Introduce common/constants.py (#10965) 2025-11-03 16:32:37 +08:00
ragflow_server.py Refa: make RAGFlow more asynchronous (#11601) 2025-12-01 14:24:06 +08:00
settings.py Move api.settings to common.settings (#11036) 2025-11-06 09:36:38 +08:00
validation.py Fix errors detected by Ruff (#3918) 2024-12-08 14:21:12 +08:00