Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refs #2243 -- Fixed manipulator handling of raw_id_admin m2m edit_inl…

…ine fields.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0d19b2eaaefead036cc71564d90cffe5e3c45df7 1 parent ae0bea8
Russell Keith-Magee authored

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  django/db/models/manipulators.py
3  django/db/models/manipulators.py
@@ -215,6 +215,9 @@ def save(self, new_data):
215 215
                         # Save many-to-many objects.
216 216
                         for f in related.opts.many_to_many:
217 217
                             if child_follow.get(f.name, None) and not f.rel.edit_inline:
  218
+                                new_value = rel_new_data[f.attname]
  219
+                                if f.rel.raw_id_admin:
  220
+                                    new_value = new_value[0]
218 221
                                 setattr(new_rel_obj, f.name, f.rel.to.objects.filter(pk__in=rel_new_data[f.attname]))
219 222
                                 if self.change:
220 223
                                     self.fields_changed.append('%s for %s "%s"' % (f.verbose_name, related.opts.verbose_name, new_rel_obj))

0 notes on commit 0d19b2e

Please sign in to comment.
Something went wrong with that request. Please try again.