From 5a2556afb9b1b3ef6e0622552970c67ac84ecd28 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Sun, 18 May 2014 20:34:32 +0200 Subject: [PATCH] Fixed regression from a2dd618e3b4a7472fab852da450ca5eef92a922f. --- django/db/backends/mysql/validation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py index cd7503a352..49c88377b7 100644 --- a/django/db/backends/mysql/validation.py +++ b/django/db/backends/mysql/validation.py @@ -17,7 +17,8 @@ class DatabaseValidation(BaseDatabaseValidation): if getattr(field, 'rel', None) is None: field_type = field.db_type(connection) - if (field_type.startswith('varchar') # Look for CharFields... + if (field_type is not None # Not all fields have a db_type (whyever...) + and field_type.startswith('varchar') # Look for CharFields... and field.unique # ... that are unique and (field.max_length is None or int(field.max_length) > 255)): errors.append(