Skip to content
Snippets Groups Projects
Commit 3c1c57f1 authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

fixing deliberate mistakes in splash.py

parent 243c1a6f
Branches
No related merge requests found
......@@ -10,6 +10,7 @@ from bson.objectid import ObjectId
import cgi
import cgitb
cgitb.enable()
from datetime import datetime
# import custom modules
from config import config
......@@ -52,5 +53,19 @@ if result:
else:
print("<p>Oops. Something went wrong!</p>")
# check if either button clicked and insert a fluck in the database
if 'btn_fluck' in form:
result = db.flucks.insert( {
"image_id":ObjectId(form['img_id'].value),
"is_flucked":1,
"timestamp":datetime.now().timestamp()
} )
elif 'btn_skip' in form:
result = db.flucks.insert( {
"image_id":ObjectId(form['img_id'].value),
"is_flucked":0,
"timestamp":datetime.now().timestamp()
} )
# render cat_stats template, passing it the dynamic data
print( utils.render_template( config['TEMPLATE_DIR']+'footer.html' ) )
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment