﻿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
15938	USE_THOUSAND_SEPARATOR breaks prepopulated_fields functionality	lev.maximov@…	nobody	"{{{
# models.py

from django.db import models

class Book(models.Model):
    slug = models.CharField(max_length=1000)
    name = models.CharField(max_length=1000)

# admin.py

from django.contrib import admin
import models

class BookAdmin(admin.ModelAdmin):
    prepopulated_fields = {
        'slug': ['name'],
    }

admin.site.register(models.Book, BookAdmin)

# settings.py

USE_L10N = True
USE_THOUSAND_SEPARATOR = True

}}}

This bug is present with most locales (including `en` and `en-gb`). Common values for `DECIMAL_SEPARATOR` are space, comma and dot. The former two generate a js error in django-generated js code, the latter one results in wrong `max_length` for slug field (1.000 = 1)

Disclaimer:

This example is somewhat artificial because `NUMBER_GROUPING` is usually 3 and it doesn't make much sense to use slugs 1000 chars long.
So the severity of the bug is not at all high. But the bug there is.

The patch is against 1.3 but at the moment of writing the issue is present in trunk as well."	Bug	closed	contrib.admin	1.3	Normal	fixed	USE_THOUSAND_SEPARATOR prepopulated_fields	mathieu.agopian@…	Accepted	1	0	0	1	1	0
