Bug fix for calling get_commons_image with 'null'
This commit is contained in:
parent
3f04c82ba9
commit
4d64ac212d
|
@ -244,9 +244,12 @@ def identifier_index():
|
||||||
|
|
||||||
@app.route("/commons/<filename>")
|
@app.route("/commons/<filename>")
|
||||||
def get_commons_image(filename):
|
def get_commons_image(filename):
|
||||||
|
if filename == "null":
|
||||||
|
flask.abort(404)
|
||||||
detail = commons.image_detail([filename], thumbheight=1200, thumbwidth=1200)
|
detail = commons.image_detail([filename], thumbheight=1200, thumbwidth=1200)
|
||||||
image = detail[filename]
|
if filename not in detail:
|
||||||
return flask.redirect(image["thumburl"])
|
flask.abort(404)
|
||||||
|
return flask.redirect(detail[filename]["thumburl"])
|
||||||
|
|
||||||
|
|
||||||
@app.route("/identifier/<pid>")
|
@app.route("/identifier/<pid>")
|
||||||
|
|
Loading…
Reference in a new issue