﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16565	An issue in databrowse's template object_detail.html	leopku	nobody	"1, Steps to reproduce the bug.

i, create a module with a foreignkey and set blank=True and null=True.

ii, create a instance of the module in step 1st, and leave the FK field empty.
iii, install 'databrowse' app and register the model to databrowse.
iv, browse the instance detail info.
An TemplateSyntaxError should be throw out.

2, Issue detail:
TemplateSyntaxError at /databrowse/appname/modelname/objects/objectid/
Caught AttributeError while rendering: 'NoneType' object has no attribute '_get_pk_val'
...
...
...
Template error

In template /opt/Documents/Source/itman/templates/databrowse/object_detail.html, error at line 13
Caught AttributeError while rendering: 'NoneType' object has no attribute '_get_pk_val'

3,How to fix.

Open object_detail.html and go to line 18.
change ""{% if field.urls %}"" to ""{% if field and field.urls %}"""	Bug	closed	contrib.databrowse	1.3	Normal	fixed	databrowse, template		Ready for checkin	1	0	1	1	0	0
