summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul McMillan <Paul@McMillan.ws>2011-09-22 06:37:50 +0000
committerPaul McMillan <Paul@McMillan.ws>2011-09-22 06:37:50 +0000
commitc59339f450343960ee5dd2e2bb8d1a8507ccdaba (patch)
treef4514c8775c2aec6644554a3ba561196f47938a4
parent0bd0bb7c2220339f20a6df1ce143e70c8955d1df (diff)
Fixed #16565 -- Fixed a databrowse error on null foreign key, even though databrowse is deprecated. Thanks aaugustin for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/databrowse/datastructures.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/databrowse/datastructures.py b/django/contrib/databrowse/datastructures.py
index 4fcdba9d33..9a4ba17e19 100644
--- a/django/contrib/databrowse/datastructures.py
+++ b/django/contrib/databrowse/datastructures.py
@@ -184,6 +184,8 @@ class EasyInstanceField(object):
if self.field.rel.to in self.model.model_list:
lst = []
for value in self.values():
+ if value is None:
+ continue
url = mark_safe('%s%s/%s/objects/%s/' % (self.model.site.root_url, m.model._meta.app_label, m.model._meta.module_name, iri_to_uri(value._get_pk_val())))
lst.append((smart_unicode(value), url))
else: