Code

Ticket #13004: catch_value_error.diff

File catch_value_error.diff, 609 bytes (added by hejsan, 4 years ago)

Very simple fix, just catch one more Exception

Line 
1Index: django/contrib/admin/helpers.py
2===================================================================
3--- django/contrib/admin/helpers.py     (revision 12625)
4+++ django/contrib/admin/helpers.py     (working copy)
5@@ -154,7 +154,7 @@
6         field, obj, model_admin = self.field, self.form.instance, self.model_admin
7         try:
8             f, attr, value = lookup_field(field, obj, model_admin)
9-        except (AttributeError, ObjectDoesNotExist):
10+        except (AttributeError, ValueError, ObjectDoesNotExist):
11             result_repr = EMPTY_CHANGELIST_VALUE
12         else:
13             if f is None: