Return 404 if we try to reload_metadata on a missing file.
This commit is contained in:
parent
8a44c8ec2e
commit
017523bdac
1 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@ import urllib.parse
|
|||
|
||||
from voussoirkit import cacheclass
|
||||
from voussoirkit import flasktools
|
||||
from voussoirkit import pathclass
|
||||
from voussoirkit import stringtools
|
||||
|
||||
import etiquette
|
||||
|
@ -176,7 +177,10 @@ def post_photo_refresh_metadata_core(photo_ids):
|
|||
for photo in photos:
|
||||
photo._uncache()
|
||||
photo = common.P_photo(photo.id, response_type='json')
|
||||
photo.reload_metadata()
|
||||
try:
|
||||
photo.reload_metadata()
|
||||
except pathclass.NotFile:
|
||||
flask.abort(404)
|
||||
if photo.thumbnail is None:
|
||||
try:
|
||||
photo.generate_thumbnail()
|
||||
|
|
Loading…
Reference in a new issue