diff options
| author | Igor Támara <igor@tamarapatino.org> | 2013-03-01 00:01:25 -0500 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-03-06 21:38:44 -0300 |
| commit | e2ee02c5bd412a6a1b33353cac1a222be989d71f (patch) | |
| tree | 42bbc120fbcf4429bae534de4486b0fc048c377b /django | |
| parent | c31a9793c62457a68217326e9dfded8f0fb38d96 (diff) | |
Fixed #19951 -- Admin: Invalid model PK values shouldn't cause 500 status.
Avoid ValueError in admin when passing a string as PK for an inherited
model with an integer PK field.
Thanks ikks for the patch. See also #11191.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/options.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index cce92c6a95..567f7cf990 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -501,7 +501,7 @@ class ModelAdmin(BaseModelAdmin): try: object_id = model._meta.pk.to_python(object_id) return queryset.get(pk=object_id) - except (model.DoesNotExist, ValidationError): + except (model.DoesNotExist, ValidationError, ValueError): return None def get_changelist_form(self, request, **kwargs): |
