Fixed regression from a2dd618e3b.

This commit is contained in:
Florian Apolloner 2014-05-18 20:34:32 +02:00
parent 949ee521fa
commit 5a2556afb9
1 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,8 @@ class DatabaseValidation(BaseDatabaseValidation):
if getattr(field, 'rel', None) is None: if getattr(field, 'rel', None) is None:
field_type = field.db_type(connection) 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.unique # ... that are unique
and (field.max_length is None or int(field.max_length) > 255)): and (field.max_length is None or int(field.max_length) > 255)):
errors.append( errors.append(