django/django — pull request #1109 by cvitan (2013-05-18 13:28:01+00:00)
Title: Fixes #20440 - forms.CharField should return an exception if max_length is not an integer

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.