diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-05 19:44:43 +0200 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-08 13:05:09 +0200 |
commit | e81e319f15f448d550d7e30b204d9490a9999b99 (patch) | |
tree | 7e790e0ba614ac2084ca9c65c4b60f687b73e92b /django/db/backends/mysql/validation.py | |
parent | 1fff8daf889822aa1dd9adba19c94bb522d960b4 (diff) | |
download | django-e81e319f15f448d550d7e30b204d9490a9999b99.tar.gz |
Fixed #20025 -- Pointed to a MySQLdb fork for Python 3.
Made a few minor compatibility adjustments.
Diffstat (limited to 'django/db/backends/mysql/validation.py')
-rw-r--r-- | django/db/backends/mysql/validation.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py index de7474d1e5..2ce957cce7 100644 --- a/django/db/backends/mysql/validation.py +++ b/django/db/backends/mysql/validation.py @@ -10,6 +10,7 @@ class DatabaseValidation(BaseDatabaseValidation): from django.db import models varchar_fields = (models.CharField, models.CommaSeparatedIntegerField, models.SlugField) - if isinstance(f, varchar_fields) and f.max_length > 255 and f.unique: + if (isinstance(f, varchar_fields) and f.unique + and (f.max_length is None or int(f.max_length) > 255)): msg = '"%(name)s": %(cls)s cannot have a "max_length" greater than 255 when using "unique=True".' errors.add(opts, msg % {'name': f.name, 'cls': f.__class__.__name__}) |