Fix subclass protection when ContentType is stale
This commit is contained in:
@@ -110,7 +110,7 @@ class PolymorphicModel(six.with_metaclass(PolymorphicModelBase, models.Model)):
|
||||
|
||||
# Protect against bad imports (dumpdata without --natural) or other
|
||||
# issues missing with the ContentType models.
|
||||
if not issubclass(model, self.__class__):
|
||||
if model is not None and not issubclass(model, self.__class__):
|
||||
raise RuntimeError("ContentType {0} for {1} #{2} does not point to a subclass!".format(
|
||||
self.polymorphic_ctype_id, model, self.pk,
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user