From f3c1d0dc8ef8acdd707bc625b6d7296df230b187 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 24 Oct 2011 03:10:54 +0100 Subject: [PATCH] slightly bad hack to deal with orphaned content-types --- itf/app/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index 5558ab1..c14324c 100755 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -20,8 +20,11 @@ def splitSearch(string): #i see the point of this function, but please clean it up: refer to 'except MultipleObjectsReturned' to see why this is here. def get_real_ctype(module_name): for c in ContentType.objects.filter(model=module_name): - if c.model_class().is_itf_model == True: - return c + try: + if c.model_class().is_itf_model == True: + return c + except: + pass return None class ItfModel(models.Model):