From e2f524ca09bacef4545b56dc3f136655fa0b912c Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 23 Feb 2008 00:23:57 +0000 Subject: queryset-refactor: Fixed the case of calling update() on a model manager. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7146 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/db/models/sql') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index fba4a088f0..20dcb4b71d 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1240,7 +1240,8 @@ class UpdateQuery(Query): values.append('%s = NULL' % qn(name)) result.append(', '.join(values)) where, params = self.where.as_sql() - result.append('WHERE %s' % where) + if where: + result.append('WHERE %s' % where) return ' '.join(result), tuple(update_params + params) def clear_related(self, related_field, pk_list): -- cgit v1.3