Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed #28393 -- Added a helpful exception for invalid AutoField/IntegerField values. #8760
When a large model is updated and saved with invalid values, it produces a traceback deep within the ORM, with no clue which field assignment caused the error. Developers are faced with tracebacks like:
This change displays the field name which makes spotting errors a lot easier.
For example, it shows:
Trac issue: https://code.djangoproject.com/ticket/28393
My apologies for not noticing the test issues; I ran a plain
I've fixed the test issues now by reraising the original exception type, and using the
I'm a bit in a doubt whether the
Looking into the difference:
While you're at it, can you do the same for
I also noticed that, while there are no conflicts with the base branch, that this pull request branch is "1204 commits behind django:master". That is very far behind and the repository has had many significant changes including removal of support for Python 2. Perhaps it is worth rebasing against upstream master?
@pope1ni, I've updated the
@timgraham, before I continue writing extra tests, I wonder about one thing: The other field types (
Would it make sense to port the