Ticket #16565: django-databrowse-fix-crash-on-null-foreign-keys.patch

File django-databrowse-fix-crash-on-null-foreign-keys.patch, 651 bytes (added by aaugustin, 4 years ago)
  • django/contrib/databrowse/datastructures.py

    old new  
    184184            if self.field.rel.to in self.model.model_list:
    185185                lst = []
    186186                for value in self.values():
     187                    if value is None:
     188                        continue
    187189                    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())))
    188190                    lst.append((smart_unicode(value), url))
    189191            else:
Back to Top