diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2015-02-16 17:08:19 +0100 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2015-02-16 17:14:33 +0100 |
| commit | 681efedce4c55cc685e044899f5dabac57d6766f (patch) | |
| tree | 7ebcce900ce8f7eaead3f85ecf46b2b5ed196f49 | |
| parent | e63d9b98e7c5a19e94f45eb85a1f2e53f95a1a7a (diff) | |
[1.8.x] Explicitly checked for LookupError in contenttypes migration
Backport of 4dd1f4c5eb7a617c1ee512e7a7c732d530e13916 from master
| -rw-r--r-- | django/contrib/contenttypes/migrations/0002_remove_content_type_name.py | 2 |
1 files changed, 1 insertions, 1 deletions
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() |
