Error !

UnboundLocalError: local variable 'book' referenced before assignment

<!-- ${book_dealers} --> % if book.get('imagepath',''): % if len(book.get('imagepath','')) == 4 or len(book.get('imagepath','')) == 0: <div class="image nobook"></div> % elif len(book.get('imagepath','')) > 4: <div class="image"> <img src="${site.attr('bookimg')}/${book.get('imagepath','')}/medium" />
memory:0x7ff089158590, line 14:
% if book.get('imagepath',''):
templates/default/fribokhandel, line 57:
${self.main_content()}
/srv/dd-web02/limecms/fribokhandel/fribokhandel01/local/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 899:
callable_(context, *args, **kwargs)
/srv/dd-web02/limecms/fribokhandel/fribokhandel01/local/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 873:
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
/srv/dd-web02/limecms/fribokhandel/fribokhandel01/local/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 838:
**_kwargs_for_callable(callable_, data))
/srv/dd-web02/limecms/fribokhandel/fribokhandel01/local/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/template.py, line 462:
return runtime._render(self, self.callable_, args, data)
/var/limecms/fribokhandel/fribokhandel01/fribokhandel-inst/Products/LimeTemplate/LimeTemplate.py, line 703:
html = mytemplate.render(object=object, site=site, **extra)