Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16619 closed Bug (needsinfo)

Unable to delete IDs > 999 in contrib.admin with THOUSAND_SEPERATOR=True

Reported by: Patrick Bregman <patrick.bregman@…> Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Normal Keywords: admin, THOUSAND_SEPERATOR, delete
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


While cleaning up some objects from my tests I noticed that I cannot delete objects with a PK/ID over 999 when THOUSAND_SEPERATOR=True is set. For example, given an object with PK 18240, this is turned into 18.240 when rendered on the admin site. This, in turn, means it is not possible to turn it back into an int.

The exact error message in my case is below, the traceback is posted on dpaste:

ValueError at /admin/companies/company/
invalid literal for int() with base 10: '18.240'

Steps to reproduce:

  1. Start a Django project with an application
  2. Create a (simple) model
  3. Add >1000 objects of the model in 2
  4. Add the admin app to your URLs
  5. Create an admin for your model
  6. Log in to the admin
  7. Try deleting a object with id > 1000

This was noticed under Django 1.2.5

Change History (3)

comment:1 Changed 7 years ago by Aymeric Augustin

Resolution: needsinfo
Status: newclosed

I think there's a typo in the description: the setting is USE_THOUSAND_SEPARATOR = True.

i can't reproduce this under Django 1.3; if you can, please provide more details and re-open the ticket.

Note that this isn't a security problem, so it won't be fixed in 1.2.x, and it isn't critical, so it won't be fixed in 1.3.x either. But if the bug still exists, we want to fix it in 1.4. See the backport policy described at for more information.

comment:2 Changed 7 years ago by Patrick Bregman <patrick.bregman@…>

I indeed made a typo there. Also, this seems to be unreproducable under Django 1.3. Looks like it was already fixed then.

comment:3 Changed 7 years ago by Julien Phalip

For the record, this was fixed in [15435].

Note: See TracTickets for help on using tickets.
Back to Top