Fixed #36813 -- Made CharField.max_length and DecimalField's - #21671
Fixed #36813 -- Made CharField.max_length and DecimalField's#21671Prachi-Gupta2808 wants to merge 1 commit into
Conversation
max_digits/decimal_places validation happen at initialization. Moved simple, static validation (positive integer, non-negative integer checks) from the system check framework into __init__(), so invalid values raise ValueError immediately -- including for fields not attached to a model (e.g. as an output_field for Cast()). Thanks Jacob Walls for the report, and Mehraz Hossain Rumman for the initial patch in PR django#20439.
There was a problem hiding this comment.
Hello! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
|
Thank you for your contribution to Django! This pull request has one or more items that need attention before it can be accepted for review.
|
|
@github-actions please re-check I have updated the Trac ticket (#36813) and set the "Has patch" flag as required. |
Trac ticket number
ticket-36813
Branch description
Moves CharField.max_length and DecimalField.max_digits/decimal_places
validation from system checks into init(), raising ValueError
immediately for invalid values instead of only via manage.py check.
AI Assistance Disclosure (REQUIRED)
Claude for verification of work after I wrote the code myself and ran all tests to make sure if I did not make any wrong changes.
Checklist
mainbranch.