1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

Explicitly checked for LookupError in contenttypes migration

This commit is contained in:
Markus Holtermann 2015-02-16 17:08:19 +01:00
parent e35c70bef4
commit 4dd1f4c5eb

View File

@ -9,7 +9,7 @@ def add_legacy_name(apps, schema_editor):
for ct in ContentType.objects.all(): for ct in ContentType.objects.all():
try: try:
ct.name = apps.get_model(ct.app_label, ct.model)._meta.object_name ct.name = apps.get_model(ct.app_label, ct.model)._meta.object_name
except: except LookupError:
ct.name = ct.model ct.name = ct.model
ct.save() ct.save()