Example #1
0
def index():
    if request.method == 'POST':
        for x in request.form.getlist("delete"):
            delete_(x.replace("/", ''))
    message = check()
    message.reverse()
    return render_template("index.html", messages=message, num=str(len(message)), addr=addr)
Example #2
0
def sent():
    try:
        if request.method == 'POST':
            for x in request.form.getlist("delete"):
                empty_sent(x.replace("/", ''))
        c = db.sent.find("sent", "all")
        message = []
        for x in c:
            message.append(x)
        message.reverse()
        return render_template("sent.html", messages=message, num=str(len(check())), addr=addr)
    except:
        return "<script>alert('You have not sent any messages yet.');window.location = '/';</script>"