def lb(): accounts = db.get_all_accounts() for row in accounts: row['kept'] = row['kept'].strftime('%Y/%m/%d') results = { "book": accounts, } return jsonify(results)
def getMail(): """ An example get request to send all mail data stored in static file location. """ try: if request.method == 'GET': data = json.loads('{ "accounts" : [] }') data['accounts'] = db.get_all_accounts() return jsonify(status=200, text=json.dumps(data)) #send all accounts except Exception as e: return jsonify(status=500, text=str(e))
def challenge(): t = time.perf_counter() if request.method == "GET": return render_template("challenge.html", employees=employees, sec="{:.7f}".format(time.perf_counter() - t)) if request.method == "POST": answer = request.form.getlist("answer") # If you can enumerate all accounts, I'll give you FLAG! if set(answer) == set(account.name for account in db.get_all_accounts()): message = app.FLAG else: message = "Wrong!!" return render_template("challenge.html", message=message, employees=employees, sec="{:.7f}".format(time.perf_counter() - t))