diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-06-02 20:19:07 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-06-02 20:19:07 +0200 |
| commit | b81032556cc1acd245edcff9b0ae646334daba53 (patch) | |
| tree | 2b628a2fb8a738bb77629da159bb4fc91fc58bdb /app.py | |
| parent | 27c106730f8be6f2f09d1cd6bc554bae70fdc252 (diff) | |
| download | jokevote-b81032556cc1acd245edcff9b0ae646334daba53.tar.gz jokevote-b81032556cc1acd245edcff9b0ae646334daba53.zip | |
ajaxify reports, unvotes; allow undelete
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -262,6 +262,15 @@ def delete(): db().removeJoke(objectId, ip) return redirect('/page/' + page) +@app.route('/undelete', methods=['POST']) +def undelete(): + objectId = int(request.form['id']) + page = request.form['redirpage'] + ip = request.remote_addr + if objectId in db().getUserJokes(ip): + db().unvoteJoke(objectId, ip) + return redirect('/page/' + page) + @app.route('/static/<path:path>') def get_static(path): return send_from_directory('static', path) |
