zsoldosp / django-currentuser

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

Wondering why null=True? #57

Open ShmuelTreiger opened 2 years ago

ShmuelTreiger commented 2 years ago

For my purposes I'd rather have null=False and it errors out if the value is None. Wondering the thought process on enforcing null=True?

zachbellay commented 3 months ago

@ShmuelTreiger My assumption is that you can create objects without having a logged in user. For example, if you run python manage.py createsuperuser there is no logged in user, so the created_by field should be None. Another situation might be for an async task. In essence, the case where created_by=None would be where the system created the object.