Commits

Anonymous committed 35dc5cb

[soc2009/admin-ui] Omitting an extra comma at the end of the ID list for M2M autocomplete

  • Participants
  • Parent commits 05f5eff
  • Branches soc2009/admin-ui

Comments (0)

Files changed (1)

File django/contrib/admin/templates/widget/m2m_searchinput.html

             'model_name': '{{ model_name }}'
         },
         multiple: true,
-        mustMatch: true,
-        autoFill: true
+        mustMatch: true
     }).result(function(event, data, formatted) {
         if (data) {
-            $('#id_{{ name }}').val($('#id_{{ name }}').val() + data[1] + ",");
+            if ($('#id_{{ name }}').val()) {
+                $('#id_{{ name }}').val($('#id_{{ name }}').val() + "," + data[1]);
+            }
+            else {
+                $('#id_{{ name }}').val(data[1]);
+            }
+            
         }
     });
 });