#16565: An issue in databrowse's template object_detail.html
----------------------------------+------------------------------------
Reporter: leopku | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: contrib.databrowse
Version: 1.3 | Severity: Normal
Keywords: databrowse, template | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------+------------------------------------
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 %}"
--
Ticket URL: <https://code.djangoproject.com/ticket/16565>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.