zsoldosp / django-currentuser

Conveniently store reference to request user on thread/db level.
BSD 3-Clause "New" or "Revised" License
157 stars 40 forks source link

on_delete should be a required parameter #66

Open haerrel opened 1 year ago

haerrel commented 1 year ago

IMO the CurrentUserField should not have on_delete=CASCADE as a default parameter. Instead it should align with Django (3.2) ForeignKey field implementation, where the parameter for on_delete is required.

The current behaviour might lead to unwanted deletion if the user is deleted.

Thank you for considering my request.

melboone commented 1 year ago

I concur. Working on an app where on_delete=models.PROTECT is the default option.