AttributeError on syncdb
|Reported by:||Nikolay Zakharov||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||master|
|Severity:||Normal||Keywords:||syncdb management contenttypes|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When one have stale content types and trying to do syncdb, following error occurs:
Syncing... Creating tables ... Traceback (most recent call last): File "./manage.py", line 9, in <module> execute_manager(settings) ... traceback File "/usr/lib/python2.6/dist-packages/django/contrib/contenttypes/management.py", line 47, in update_contenttypes content_type_display = '\n'.join([' %s | %s' % (ct.app_label, ct.model) for ct in content_types]) AttributeError: 'unicode' object has no attribute 'app_label'
This is because of type mismatch in list comprehension: content_types was list of objects, but now it is a dict with app_labels as keys and models as values.