Merge pull request #433 from mjc/artistpage-invalid

Check for None when requesting an artist page
This commit is contained in:
rembo10
2012-01-01 16:31:05 -08:00

View File

@@ -44,6 +44,8 @@ class WebInterface(object):
myDB = db.DBConnection()
artist = myDB.action('SELECT * FROM artists WHERE ArtistID=?', [ArtistID]).fetchone()
albums = myDB.select('SELECT * from albums WHERE ArtistID=? order by ReleaseDate DESC', [ArtistID])
if artist is None:
raise cherrypy.HTTPRedirect("home")
return serve_template(templatename="artist.html", title=artist['ArtistName'], artist=artist, albums=albums)
artistPage.exposed = True