﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2972	Auto population doesn't work for multiple slugs on the same model	Archatas <aidas.bendoraitis at gmail>	Adrian Holovaty	"If there is a model with more than one !SlugField, then the javascript for automatic slug population is generated only for the last slug field of the model in the contributed administration.

The problem is simple and fixable in minutes.
The template tag auto_populated_field_script in django/contrib/admin/templatetags/admin_modify.py overwrites the previously collected javascript within every new iteration:
{{{
def auto_populated_field_script(auto_pop_fields, change = False):
    for field in auto_pop_fields:
         t = []
         ...
    return ''.join(t)
}}}

What has to be changed is that the t list has to be defined before iteration start:

{{{
def auto_populated_field_script(auto_pop_fields, change = False):
    t = []
    for field in auto_pop_fields:
         ...
    return ''.join(t)
}}}
"	defect	closed	contrib.admin	dev	normal	worksforme			Unreviewed	1	0	0	0	0	0
