Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#9484 closed (duplicate)

Admin, raw_id_fields, not int value

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In admin, raw_id_fields
whet typed not integer value:

Traceback (most recent call last):

File "/opt/elec/python/django/core/handlers/", line 86, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/opt/elec/python/django/contrib/admin/", line 158, in root
return self.model_page(request, *url.split('/', 2))

File "/opt/elec/python/django/views/decorators/", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

File "/opt/elec/python/django/contrib/admin/", line 177, in model_page
return admin_obj(request, rest_of_url)

File "/opt/elec/python/django/contrib/admin/", line 191, in __call__
return self.add_view(request)

File "/opt/elec/python/django/db/", line 238, in _commit_on_success
res = func(*args, **kw)

File "/opt/elec/python/django/contrib/admin/", line 490, in add_view
if form.is_valid():

File "/opt/elec/python/django/forms/", line 120, in is_valid
return self.is_bound and not bool(self.errors)

File "/opt/elec/python/django/forms/", line 111, in _get_errors

File "/opt/elec/python/django/forms/", line 224, in full_clean
value = field.clean(value)

File "/opt/elec/python/django/forms/", line 650, in clean
value = self.queryset.get(**{key: value})

File "/opt/elec/python/django/db/models/", line 297, in get
clone = self.filter(*args, **kwargs)

File "/opt/elec/python/django/db/models/", line 483, in filter
return self._filter_or_exclude(False, *args, **kwargs)

File "/opt/elec/python/django/db/models/", line 501, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))

File "/opt/elec/python/django/db/models/sql/", line 1224, in add_q

File "/opt/elec/python/django/db/models/sql/", line 1167, in add_filter
self.where.add((alias, col, field, lookup_type, value), connector)

File "/opt/elec/python/django/db/models/sql/", line 48, in add
params = field.get_db_prep_lookup(lookup_type, value)

File "/opt/elec/python/django/db/models/fields/", line 202, in get_db_prep_lookup
return [self.get_db_prep_value(value)]

File "/opt/elec/python/django/db/models/fields/", line 353, in get_db_prep_value
return int(value)

UnicodeEncodeError: 'decimal' codec can't encode character u'\u041f' in position 0: invalid decimal Unicode string

Change History (1)

comment:1 Changed 7 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

#8746 covers this.

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