Kaydet (Commit) 6ed780d7 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #5102 -- Fixed model saving so that 0 can be used as a primary key value. Thanks, oggie rob.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 8b115c7f
......@@ -209,7 +209,7 @@ class Model(object):
# First, try an UPDATE. If that doesn't update anything, do an INSERT.
pk_val = self._get_pk_val()
pk_set = bool(pk_val)
pk_set = pk_val is not None
record_exists = True
if pk_set:
# Determine whether a record with the primary key already exists.
......
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