def profile(): error=request.args.get("type") return render_template("profile.html",type_change=error, prefs=utils.getPrefs(session["username"]))
print("1") print request.form.get("pref","") print request.form.get("pref","")=="" start = request.form.get("start","") end = request.form.get("end","") print(start) print(end) #fields were left blank if start == None or end == None: return render_template("route.html", error=1) stationList = hopstopScraper.getRoutes(start, end) results = [] stations= [] if request.form.get("pref","") != "": pref = request.form.get("pref","") oldprefs = utils.getPrefs(session["username"]) oldprefs[pref]=True utils.updatePrefs(session["username"],oldprefs) elif request.form.get("pref2","") != "": pref = request.form.get("pref","") else: pref = "food" for station in stationList: print station print pref try: yelplist = yelp.search(pref,station) results.append(yelplist) stations.append(station) except KeyError: print "Yelp did not find any matches for this station"