django-currentuser icon indicating copy to clipboard operation
django-currentuser copied to clipboard

Wondering why null=True?

Open ShmuelTreiger opened this issue 4 years ago • 1 comments

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?

ShmuelTreiger avatar Nov 29 '21 22:11 ShmuelTreiger

@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.

zachbellay avatar Apr 01 '24 21:04 zachbellay