Connexions/cnx-authoring — pull request #43 by karenc (2014-05-02 19:45:51+00:00)
Title: Add title overrides

This should fix the error phil was seeing when updating a binder:

```
ERROR:waitress:Exception when serving /contents/33a503d5-5e19-464a-b0d0-358ae22f0171@draft.json
Traceback (most recent call last):
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/channel.py", line 337, in service
task.service()
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/task.py", line 173, in service
self.execute()
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/waitress-0.8.8-py2.7.egg/waitress/task.py", line 392, in execute
app_iter = self.channel.server.application(env, start_response)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/router.py", line 272, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/router.py", line 247, in invoke_subrequest
response = handle_request(request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/router.py", line 163, in handle_request
response = view_callable(context, request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/config/views.py", line 329, in attr_view
return view(context, request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/config/views.py", line 305, in predicate_wrapper
return view(context, request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/config/views.py", line 355, in rendered_view
result = view(context, request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/pyramid-1.5b1-py2.7.egg/pyramid/config/views.py", line 501, in _requestonly_view
response = view(request)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/cnx_authoring-0.1-py2.7.egg/cnxauthoring/views.py", line 37, in wrapper
return function(request, *args, **kwargs)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/cnx_authoring-0.1-py2.7.egg/cnxauthoring/views.py", line 279, in put_content
for key, value in utils.utf8(content.to_dict()).items():
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/cnx_authoring-0.1-py2.7.egg/cnxauthoring/models.py", line 253, in to_dict
result['tree'] = cnxepub.model_to_tree(self)
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/cnx_epub-0.1-py2.7.egg/cnxepub/models.py", line 62, in model_to_tree
item = model_to_tree(node, model.get_title_for_node(node),
File "/Users/phil/Sites/cnx-authoring/lib/python2.7/site-packages/cnx_epub-0.1-py2.7.egg/cnxepub/models.py", line 257, in get_title_for_node
return self._title_overrides[index]
IndexError: list index out of range
```