summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/core/meta/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py
index d28cb04f88..e50870d9c7 100644
--- a/django/core/meta/__init__.py
+++ b/django/core/meta/__init__.py
@@ -735,7 +735,7 @@ def method_save(opts, self):
# Determine whether a record with the primary key already exists.
cursor.execute("SELECT 1 FROM %s WHERE %s=%%s LIMIT 1" % (opts.db_table, opts.pk.name), [pk_val])
# If it does already exist, do an UPDATE.
- if cursor.rowcount > 0:
+ if cursor.fetchone():
db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.name), False)) for f in non_pks]
cursor.execute("UPDATE %s SET %s WHERE %s=%%s" % (opts.db_table,
','.join(['%s=%%s' % f.name for f in non_pks]), opts.pk.name),