Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jacob Kaplan-Moss authored November 07, 2006

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/serializers/python.py
2  django/core/serializers/python.py
@@ -76,7 +76,7 @@ def Deserializer(object_list, **options):
76 76
                 m2m_data[field.name] = field.rel.to._default_manager.in_bulk(field_value).values()
77 77
                 
78 78
             # Handle FK fields
79  
-            elif field.rel and isinstance(field.rel, models.ManyToOneRel):
  79
+            elif field.rel and isinstance(field.rel, models.ManyToOneRel) and field_value is not None:
80 80
                 try:
81 81
                     data[field.name] = field.rel.to._default_manager.get(pk=field_value)
82 82
                 except field.rel.to.DoesNotExist:

0 notes on commit febe05b

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