Commit 266f0d19 authored by gushitong's avatar gushitong

bugfix for magic_pk is None

parent 03c344bd
__version__ = '0.0.9'
__version__ = '0.1.0'
__author__ = 'gushitong@gmei.com'
......@@ -27,6 +27,10 @@ class MagicDescriptor(object):
related_obj_pk = getattr(instance, "%s_id" % self.field.attname)
if not related_obj_pk:
# process `blank=True` and `null=True`
return None
if getattr(instance, self.lazy_name, False):
return related_obj_pk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment