#27397: Querying with an integer larger than SQLite supports crashes with
OverflowError
-------------------------------------+-------------------------------------
     Reporter:  Ramin Farajpour      |                    Owner:  Ramin
  Cami                               |  Farajpour Cami
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.10
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  SQLite, Error        |             Triage Stage:  Accepted
  Handling                           |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Ramin Farajpour Cami):

 i think you means this , this patch is a very easy Tim, and best way,


 {{{
 $ git diff HEAD
 diff --git a/django/contrib/admin/options.py
 b/django/contrib/admin/options.py
 index 499d27d..58049ed 100644
 --- a/django/contrib/admin/options.py
 +++ b/django/contrib/admin/options.py
 @@ -668,7 +668,7 @@ class ModelAdmin(BaseModelAdmin):
          try:
              object_id = field.to_python(object_id)
              return queryset.get(**{field.name: object_id})
 -        except (model.DoesNotExist, ValidationError, ValueError):
 +        except (model.DoesNotExist, ValidationError, ValueError,
 OverflowError):
              return None

      def get_changelist_form(self, request, **kwargs):

 }}}

 view :


 {{{
 Page not found (404)
 Request Method: GET
 Request URL:
 http://127.0.0.1:8000/admin/auth/user/1111111111111111111111111111/change/
 Raised by:      django.contrib.admin.options.change_view
 user object with primary key u'1111111111111111111111111111' does not
 exist.
 }}}

 Overflow Code ;
 {{{
 return queryset.get(**{field.name: object_id})
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27397#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.6f556823a7ac03c4de400639bbabfd49%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to