def my_beef(): """ Render a list of beefs created by the current user """ #if not current_user.is_authenticated(): # return render_template('login.html') try: beef_list = beef.get_beef_list(current_user.id) except: print traceback.format_exc() return render_template('500.html') #return render_template('my_beef.html', beef_list=[]) return render_template('my_beef.html', beef_list=beef_list),
def user(): """ Show a particular user """ try: _id = request.args.get('_id', '') (user_dict, kwargs) = login_tools.get_user(_id) beef_list = beef.get_beef_list(_id) beef_against_list = beef.get_beef_against_list(_id) except InvalidUser: print traceback.format_exc() return render_template("404.html") except: print traceback.format_exc() return render_template('500.html') return render_template("user.html", user=user_dict, beef_list=beef_list, beef_against_list=beef_against_list, **kwargs)