From dbcf2ffa77af24642c035c58199e6058d91d8e35 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 16 Jan 2019 09:20:04 -0500 Subject: [PATCH] Refs #9475 -- Simplified dictionary unpacking. --- django/db/models/fields/related_descriptors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/fields/related_descriptors.py b/django/db/models/fields/related_descriptors.py index ffeaf09987..02b5bcb62e 100644 --- a/django/db/models/fields/related_descriptors.py +++ b/django/db/models/fields/related_descriptors.py @@ -1105,10 +1105,10 @@ def create_forward_many_to_many_manager(superclass, rel, reverse): # Add the ones that aren't there already self.through._default_manager.using(db).bulk_create([ - self.through(**{**through_defaults, **{ + self.through(**through_defaults, **{ '%s_id' % source_field_name: self.related_val[0], '%s_id' % target_field_name: obj_id, - }}) + }) for obj_id in new_ids ])