mirror of https://github.com/django/django.git
[1.8.x] Explicitly checked for LookupError in contenttypes migration
Backport of 4dd1f4c5eb
from master
This commit is contained in:
parent
e63d9b98e7
commit
681efedce4
|
@ -9,7 +9,7 @@ def add_legacy_name(apps, schema_editor):
|
|||
for ct in ContentType.objects.all():
|
||||
try:
|
||||
ct.name = apps.get_model(ct.app_label, ct.model)._meta.object_name
|
||||
except:
|
||||
except LookupError:
|
||||
ct.name = ct.model
|
||||
ct.save()
|
||||
|
||||
|
|
Loading…
Reference in New Issue