Skip to content
Browse files

don't serve deleted objects

  • Loading branch information...
1 parent 18d7c98 commit 7ad8aaf4372095d4cd28e177a52af4e87f0cd09a @posativ committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 regenwolken/views.py
View
7 regenwolken/views.py
@@ -218,6 +218,9 @@ def items_view(short_id):
if request.accept_mimetypes.accept_html:
+ if obj.deleted_at:
+ abort(404)
+
if obj.item_type != 'image':
# the browser always loads the blob, so we don't want count it twice
fs.inc_count(obj._id)
@@ -282,7 +285,7 @@ def blob(short_id, filename):
fs = current_app.fs
obj = fs.get(short_id=short_id)
- if obj is None:
+ if obj is None or obj.deleted_at:
abort(404)
# views++
@@ -424,7 +427,7 @@ def thumb(short_id):
# if th: return Response(standard_b64decode(th), 200, content_type='image/png')
rv = current_app.fs.get(short_id=short_id)
- if rv is None:
+ if rv is None or rv.deleted_at:
abort(404)
if rv.item_type == 'image' and current_app.config['THUMBNAILS']:

0 comments on commit 7ad8aaf

Please sign in to comment.
Something went wrong with that request. Please try again.