Skip to content

Commit

Permalink
deleted_at is not always available
Browse files Browse the repository at this point in the history
  • Loading branch information
posativ committed Nov 10, 2012
1 parent 7ad8aaf commit 14aeeac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions regenwolken/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def items_view(short_id):

if request.accept_mimetypes.accept_html:

if obj.deleted_at:
if getattr(obj, 'deleted_at', None):
abort(404)

if obj.item_type != 'image':
Expand Down Expand Up @@ -285,7 +285,7 @@ def blob(short_id, filename):
fs = current_app.fs

obj = fs.get(short_id=short_id)
if obj is None or obj.deleted_at:
if obj is None or getattr(obj, 'deleted_at', None):
abort(404)

# views++
Expand Down Expand Up @@ -427,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 or rv.deleted_at:
if rv is None or getattr(obj, 'deleted_at', None):
abort(404)

if rv.item_type == 'image' and current_app.config['THUMBNAILS']:
Expand Down

0 comments on commit 14aeeac

Please sign in to comment.