Closed KwikKill closed 4 weeks ago
for the last point, you're right. To address this issue, we can create an anonymous user that replaces deleted account everywhere there is a reference to a deleted user. Maybe Django supports this kind of behavior?
Duplicate from #51 , but more detailed so we should keep this one instead
@KwikKill :
When a user is deleted, it should also delete their ongoing inscriptions (maybe automatic refund if possible), keep their past inscriptions (to keep events history).
Not a fan of cascading deletion of anything payment related, we probably should prevent deletion if registrations are ongoing, asking to unregister first.
@ShiroUsagi-san
Maybe Django supports this kind of behavior?
The way django intends to delete users without breaking foreign key is by setting its is_active
field to false
, so deletion could actually:
is_active
to falseDo we must keep deleted user still unique ? If not, why not make ForeignKey.on_delete = SET_DEFAULT
, with default user a deleted user (with dummy data for example)
I thought that was similar to what @Lugrim said but that's the easiest way to do this :ok_hand:
We should really ensure it doesn't break constrainsts
For the moment :
is_active
field is use nowhereuser
field from transaction model is already in on_delete=models.SET_NULL
Is there somewhere else where we have to keep an object if the user is deleted ? I have thought of :
Player
and Manager
models)I'm closing this as I will be much easier to do it manually. Having no control on account deletion is imo worst.
We have to add an endpoint that allow user to delete their account. This endpoint could be a DELETE request with some kind of validation (could be password verification).
When a user is deleted, it should also delete their ongoing inscriptions (maybe automatic refund if possible), keep their past inscriptions (to keep events history).
We also need to check GDPR rules because if a user ask for an account deletion, we may not be able to keep his team history.