rembo10/headphones — pull request #383 by palli81 (2011-11-06 23:14:44+00:00)
Title: Error 500 when adding an artist

If the importer hasn't fetched the artist info in the 5 seconds we wait CherryPy throws an error 500 when trying to render the artist.html template because it can't find the artist in the database. Fixed by inserting a placeholder artist that is later updated by the importer.

There's also a "feature" that adds a meta refresh to the artist page if status is "Loading". I'm not 100% sure about that one, what do you think?

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
File "/opt/rembo10-headphones-adcb39c/cherrypy/_cprequest.py", line 645, in respond
response.body = self.handler()
File "/opt/rembo10-headphones-adcb39c/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/opt/rembo10-headphones-adcb39c/cherrypy/_cpdispatch.py", line 29, in __call__
return self.callable(*self.args, **self.kwargs)
File "/opt/rembo10-headphones-adcb39c/headphones/webserve.py", line 47, in artistPage
return serve_template(templatename="artist.html", title=artist['ArtistName'], artist=artist, albums=albums)
TypeError: 'NoneType' object is not subscriptable