-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting user causes cascade delete on glosses #201
Comments
Also, some weird character problem occurs when deleting users and language is set to Finnish. This probably has to do with users that registered with the registration feature and filled in some information having weird characters, or something like that. Hopefully #177 will fix this. |
@Woseseltops , could you check if this is a problem for us as well? |
@ocrasborn based on Henri's descriptions I would have thought so, but apparently not: I created a gloss with the test user, and then deleted the test user, and the gloss is still there (now without a creator). The admin did mention it was going to remove the 'gloss-creator' relationship, which apparently means: not the gloss. |
I think I have spotted the reason for this. So in FinSL we use ForeignKey field for the gloss creator, in NGT m2m field is used. FKey field seems to default to on_delete=models.CASCADE We need to set on_delete=models.SET_NULL, but then we have to have make the field nullable as well. More info at: https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.ForeignKey.on_delete |
Django docs suggests that you don't delete users. Therefore this issue might be irrelevant, at least it is not a very high priority. |
Django-admin wants to cascade delete on user to glosses the user created.
We need to remove this behaviour to avoid possible mistakes causing losses of glosses.
At this moment, if you want to delete a user, just set Active false on the user instead.
The text was updated successfully, but these errors were encountered: