mirror of
https://github.com/makeplane/plane.git
synced 2026-09-02 12:09:14 +02:00
`?expand=updated_by` was reported in #4639 as returning a bare UUID because `updated_by` was missing from the expansion mapper. #7667 added the key, but that alone did not fix the reported request: `BaseModel.save` leaves `updated_by` NULL until a record is first updated, and expanding a null relation called `UserLiteSerializer(None)`, which DRF resolves via `get_initial()` to `{}`. The app layer never got the key at all, and its null case produced a ghost user with blank names. Resolve the relation off the instance instead of guessing arity from the already-serialized value, and keep a null relation null so the expanded and unexpanded responses agree. Add `updated_by` to the app mapper, and hoist its two duplicated copies into one `get_expansion_mapper()` -- the duplication is why the original fix reached only one of them. `issue_attachment` is deliberately left out of the unified mapper: it is the reverse manager of the legacy `IssueAttachment` model, which `IssueAttachmentLiteSerializer` (`model = FileAsset`) cannot serialize. Also document the supported `expand` values, which were previously undiscoverable, and add the first test coverage for `expand`. Claude-Session: https://claude.ai/code/session_0142ihfx57JhqVnvs5w73aX7