Open rachidatecs opened 3 weeks ago
Added "refinement" label, no ACs defined. @rachidatecs would you add ACs to this ticket?
temporary slotting in 55
Added ACs and some other details, marking this as ready, due to the nature of this being a code maintenance issue, would like it to be done anywhere within the next 3 sprints.
Issue description
Right now we use a brute force approach that defines which field on user and joined fields from other models need to be tackled when transferring a user. For a more solid approach, use Django's lookup to find and handle these fields.
The downside with the current approach is that the transfer setup up could break as we add in new models with joins to user and require more code maintenance.
Acceptance criteria
Additional context
I (Rachid) tried using a related field lookup when working on #2579 which was partly successful. The lookup (based on Dave's work on the 'join' alert on contacts) works, but the field update fails:
`def post(self, request, user_id): current_user = get_object_or_404(User, pk=user_id) selected_user_id = request.POST.get('selected_user') selected_user = get_object_or_404(User, pk=selected_user_id)
Links to other issues
No response