summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-06-02 20:19:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-06-02 20:19:07 +0200
commitb81032556cc1acd245edcff9b0ae646334daba53 (patch)
tree2b628a2fb8a738bb77629da159bb4fc91fc58bdb /app.py
parent27c106730f8be6f2f09d1cd6bc554bae70fdc252 (diff)
downloadjokevote-b81032556cc1acd245edcff9b0ae646334daba53.tar.gz
jokevote-b81032556cc1acd245edcff9b0ae646334daba53.zip
ajaxify reports, unvotes; allow undelete
Diffstat (limited to 'app.py')
-rw-r--r--app.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/app.py b/app.py
index 2a8aa6d..85c58d9 100644
--- a/app.py
+++ b/app.py
@@ -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)