﻿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
2129	the validate() method shouldn't ignore maxlength	tom@…	Adrian Holovaty	"The validate() method of a model does not complain when exceeding the maxlength of a CharField.
There should be an error in the returned dictionary (e.g. ""Ensure your text is less than 75 characters."")

In the following example someone could add an invalid e-mail-address without getting a validation error:

{{{
>>> import django.contrib.auth.models as auth
>>> u = auth.User.objects.get(pk=1)
>>> u.email = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@xx.xx'
>>> u.validate()
{}
>>> u.save()
/usr/lib/python2.3/site-packages/django/db/backends/mysql/base.py:35: Warning: Rows matched: 1  Changed: 1  Warnings: 1
  return self.cursor.execute(sql, params)
>>> u.validate()
{}
>>> u = auth.User.objects.get(pk=1)
>>> u.email
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
>>> u.validate()
{'email': ['Enter a valid e-mail address.']}
>>> 
}}}
"	defect	closed	Validators	dev	normal	invalid			Unreviewed	0	0	0	0	0	0
