✨(admin) derive the source user from the selection when transferring documents

未关闭
#2,913 0 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

维护者通常 3 天内回复

@lunika 已经在做这个了。

开始于 2026年10月26日。

评估

这个 Issue 还没有评估数据。

描述

backend
What problem do you want to fix?

In the admin, the "Transfer to another user" action asks the admin to pick the source user ("from") by hand, although the documents are already selected. This leads to mistakes:

  • when the selected documents have different creators, only the documents of the chosen user change creator, the others are silently left as they are;
  • when the chosen source user has nothing to do with the selection, nothing is transferred, but the confirmation banner is still green ("0 documents and 0 accesses transferred").
Image
Possible solution?

The source user comes from the selection. The transfer screen lists the selected documents grouped by creator, under the explanation text:

  • creator A
    • document 1
    • document 2
  • creator B
    • document 3
One creator

The "from" field shows that creator and cannot be edited. The admin only chooses the "to" user.

Several creators
  • A message under the explanation says the selection contains several creators and asks the admin to choose the one to transfer from.
  • The "from" field is prefilled with the creator who has the most selected documents.
  • The "from" field stays editable: the admin can type to pick another creator of the selection.
  • Only the documents of the chosen creator change creator. The documents of the other creators are left as they are, and the confirmation message says so.
Given an admin selects documents that all have the same creator
When they run the "Transfer to another user" action
Then the selected documents are listed under their creator
And the "from" field shows that creator and cannot be edited
And the admin only has to choose the "to" user to transfer

Given an admin selects documents created by different users
When they run the "Transfer to another user" action
Then the selected documents are listed grouped by creator
And a message says the selection contains several creators and asks to choose one
And the "from" field is prefilled with the creator who has the most selected documents

Given the selection contains several creators
When the admin changes the "from" field to another creator of the selection and transfers
Then only the documents of that creator and their accesses are transferred
And the confirmation message says how many selected documents were left untouched

Given the admin submits a transfer
When no document and no access is transferred
Then the confirmation banner is red (error) instead of green
And it says nothing was transferred

Implementation lead: TransferDocumentsForm and DocumentAdmin.transfer_documents in src/backend/core/admin.py, and the template core/templates/core/admin/transfer_documents.html. Use messages.ERROR in message_user when nothing was transferred.

Do you have an alternative?

Select the documents of a single creator at a time and pick the right creator by hand in the "from" field.

Upload

No response

Contact Details

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
主要语言
TypeScript
星标
17k
派生
705
平均合并
4 天 13 小时
30 天内合并 PR
47

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

suitenumerique/docs 的其他 Issue

查看 suitenumerique/docs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。