Browse files

Fixed #9341: add another on `ManyToManyField`s with `raw_id_admins` n…

…ow works correctly.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7d1b429 commit 6eaf154a2e81d21d02f3597dd0e3dad01db8d07c @jacobian jacobian committed Apr 8, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/contrib/admin/media/js/admin/RelatedObjectLookups.js
View
6 django/contrib/admin/media/js/admin/RelatedObjectLookups.js
@@ -79,7 +79,11 @@ function dismissAddAnotherPopup(win, newId, newRepr) {
elem.options[elem.options.length] = o;
o.selected = true;
} else if (elem.nodeName == 'INPUT') {
- elem.value = newId;
+ if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
+ elem.value += ',' + newId;
+ } else {
+ elem.value = newId;
+ }
}
} else {
var toId = name + "_to";

0 comments on commit 6eaf154

Please sign in to comment.