Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2921: deserialization no longer failes on NULL primary keys. T…

…hanks, mir@noris.de.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit febe05b9eff84ab1d1ec2af61f6cd8337422731a 1 parent e39a8e9
@jacobian jacobian authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/serializers/python.py
View
2  django/core/serializers/python.py
@@ -76,7 +76,7 @@ def Deserializer(object_list, **options):
m2m_data[field.name] = field.rel.to._default_manager.in_bulk(field_value).values()
# Handle FK fields
- elif field.rel and isinstance(field.rel, models.ManyToOneRel):
+ elif field.rel and isinstance(field.rel, models.ManyToOneRel) and field_value is not None:
try:
data[field.name] = field.rel.to._default_manager.get(pk=field_value)
except field.rel.to.DoesNotExist:

0 comments on commit febe05b

Please sign in to comment.
Something went wrong with that request. Please try again.