Check for None when requesting an artist page

This commit is contained in:
Michael J. Cohen
2011-12-31 02:04:04 -05:00
parent e8a476383b
commit 75212d20e0

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