def deleteIdea(title): #deletes the idea from teh database, no backsies! if session.get('logged_in'): #attempt to delete idea and show results if idea_box.deleteIdea(session['username'],title.lower()): flash("Idea deleted") return redirect(url_for('displayAll')) else: #if something fails, explain and show idea flash("Could not delete") results=idea_search.ideaQuery(session['username'],title.lower(),"","").all() return render_template('displayResults.html',results=results) else: return redirect(url_for('welcome'))
def deleteIdea(): #deletes the idea try: #create a new use with a randomly generated username print "Attempting idea deletion" session=idea_box.createAll() username="******".lower() title="A great title".lower() if idea_box.deleteIdea(username,title,session): print "Idea Deleted" else: print "Idea not deleted" session.close() except: print "Body Change error" raise else: print "Body change error free" outputIdea(username.lower(),title.lower())