From 4dd1f4c5eb7a617c1ee512e7a7c732d530e13916 Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Mon, 16 Feb 2015 17:08:19 +0100 Subject: [PATCH] Explicitly checked for LookupError in contenttypes migration --- .../contenttypes/migrations/0002_remove_content_type_name.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py b/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py index b2e18846b9..044fb615cf 100644 --- a/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py +++ b/django/contrib/contenttypes/migrations/0002_remove_content_type_name.py @@ -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()