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

Aperta
#2,913 0 commenti 0 reazioni 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@lunika ci sta già lavorando.

Dal 26/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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
Lingua principale
TypeScript
Stelle
17k
Fork
705
Merge medio
4g 13h
PR unite (30g)
47

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di suitenumerique/docs

Tutte le issue di suitenumerique/docs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.