Make non-polymorphic refs that slip through still work with our SET_NULL

This commit is contained in:
Jeff Bradberry 2021-07-13 11:36:20 -04:00
parent d0d9266dd1
commit b0c511a7a2

View File

@ -15,4 +15,6 @@ def build_polymorphic_ctypes_map(cls):
def SET_NULL(collector, field, sub_objs, using):
return models.SET_NULL(collector, field, sub_objs.non_polymorphic(), using)
if hasattr(sub_objs, 'non_polymorphic'):
sub_objs = sub_objs.non_polymorphic()
return models.SET_NULL(collector, field, sub_objs, using)