Check if request.view_name exists before sending it to the template engine

This commit is contained in:
Gergely Polonkai 2014-06-14 17:11:54 +00:00
parent 17a71ddfb6
commit ae4af3669b

View File

@ -33,6 +33,9 @@ def tagcloud(request):
return {'tagcloud': tagcloud}
def viewname(request):
return {
'view_name': request.view_name,
}
if hasattr(request, 'view_name'):
return {
'view_name': request.view_name,
}
else:
return {}