def dashboard(): db = DB('db', False) try: if session['logged_in']: song_ids = db.get_song_ids(session['email']) songs = [db.get_song_details(id) for id in song_ids] return render_template('dashboard.html', songs=songs, email=session['email']) except: return render_template('login.html') return render_template('login.html')
def song(uid): db = DB('db', False) song = db.get_song_details(uid) user = db.get_song_user(uid) db.add_view(uid) return render_template('song.html', song=song, user=user)