id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 23555 QuerySet.first suppresses internal IndexError exceptions Artem Rizhov nobody "Current implementation of this method relies on `IndexError` when checking the item existence. However this exception may be raised somewhere inside of own `__getitem__()` which does a lot of work. This way the potential errors are hidden. The method will return `None` in case of a bug that raises `IndexError` internally. The Zen of Python says ""Errors should never pass silently."" https://github.com/django/django/blob/e9103402c0fa873aea58a6a11dba510cd308cb84/django/db/models/query.py#L515" Bug closed Database layer (models, ORM) dev Normal fixed QuerySet first IndexError Ready for checkin 1 0 0 0 0 0