slightly bad hack to deal with orphaned content-types

This commit is contained in:
Sanj 2011-10-24 03:10:54 +01:00
parent d86dff8c7b
commit f3c1d0dc8e

View File

@ -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):
try:
if c.model_class().is_itf_model == True:
return c
except:
pass
return None
class ItfModel(models.Model):