another large clean up of code, all POSTs are now using make_response() and returning json OR are for a form that flask handles with rendering direct html. Where there is a POST with json response, the jscript now calls CheckForJobs() to show it in the F/E. Removed several debugs. Fixed up undocumented BUG where import datetime was wrong, and prefix/suffix also to offer directories near the date of an image. Removed unused routes for clearing messages
This commit is contained in:
11
person.py
11
person.py
@@ -249,11 +249,12 @@ def person(id):
|
||||
@app.route("/add_refimg", methods=["POST"])
|
||||
@login_required
|
||||
def add_refimg():
|
||||
# now save into the DB
|
||||
person = Person.query.get(request.form['person_id']);
|
||||
if not person:
|
||||
raise Exception("could not find person to add reference image too!")
|
||||
try:
|
||||
# now save into the DB
|
||||
person = Person.query.get(request.form['person_id']);
|
||||
if not person:
|
||||
raise Exception("could not find person to add reference image too!")
|
||||
|
||||
# save the actual uploaded image to reference_images/
|
||||
f=request.files['refimg_file']
|
||||
fname=secure_filename(f.filename)
|
||||
@@ -285,7 +286,7 @@ def find_persons(who):
|
||||
resp[p.id]['firstname']=p.firstname
|
||||
resp[p.id]['surname']=p.surname
|
||||
|
||||
return resp
|
||||
return make_response( resp )
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user