From 8e453ad2213a2e54caa4cd87d3d6f31558ac8a4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89tienne=20Loks?= <etienne.loks@iggdrasil.net>
Date: Fri, 12 Jan 2018 17:08:00 +0100
Subject: [PATCH] Fix delete on update
---
django/db/models/deletion.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
index 26073be3ba..590d5a2298 100644
a
|
b
|
class Collector(object):
|
286 | 286 | |
287 | 287 | # update fields |
288 | 288 | for model, instances_for_fieldvalues in six.iteritems(self.field_updates): |
289 | | query = sql.UpdateQuery(model) |
290 | 289 | for (field, value), instances in six.iteritems(instances_for_fieldvalues): |
| 290 | query = sql.UpdateQuery(model) |
291 | 291 | query.update_batch([obj.pk for obj in instances], |
292 | 292 | {field.name: value}, self.using) |
293 | 293 | |