summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/newforms/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/newforms/models.py b/django/newforms/models.py
index 9bd6a3ff83..a938b6350e 100644
--- a/django/newforms/models.py
+++ b/django/newforms/models.py
@@ -37,7 +37,7 @@ def save_instance(form, instance, commit=True):
if commit:
instance.save()
for f in opts.many_to_many:
- setattr(instance, f.attname, getattr(instance, f.attname).model.objects.filter(pk__in = clean_data[f.name]))
+ setattr(instance, f.attname, clean_data[f.name])
# GOTCHA: If many-to-many data is given and commit=False, the many-to-many
# data will be lost. This happens because a many-to-many options cannot be
# set on an object until after it's saved. Maybe we should raise an