diff --git a/django/db/models/base.py b/django/db/models/base.py index 8b021978ed..064dc8fdec 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -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.