forms.CharField should return an exception if max_length is not an integer
|Reported by:||Tome Cvitan||Owned by:||Tome Cvitan|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In models.CharField you can define a verbose_name by placing a string as the first parameter, i.e. models.CharField("foo")
If you by mistake happen to define a forms.CharField with the same pattern, i.e. forms.CharField("foo"), there will be no error message and the input field will be rendered with the attribute maxlength="foo" which is invalid.
The proposed solution is to attempt to cast non-empty max_length and min_length values to an int in the init method of CharField.