mirror of
https://github.com/django/django.git
synced 2025-11-19 11:15:44 +00:00
Fixed #13004: Ensure the add page for a model with a ManyToManyField specified
in readonly_fields does not raise an exception. Thanks hejsan, mlavin, copelco. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12827 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8661cb9bd3
commit
f88c2f16e8
3 changed files with 18 additions and 1 deletions
|
|
@ -154,7 +154,7 @@ class AdminReadonlyField(object):
|
|||
field, obj, model_admin = self.field, self.form.instance, self.model_admin
|
||||
try:
|
||||
f, attr, value = lookup_field(field, obj, model_admin)
|
||||
except (AttributeError, ObjectDoesNotExist):
|
||||
except (AttributeError, ValueError, ObjectDoesNotExist):
|
||||
result_repr = EMPTY_CHANGELIST_VALUE
|
||||
else:
|
||||
if f is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue