image might not be ready
This commit is contained in:
parent
ee3b7a1a9a
commit
0043eab61d
1 changed files with 2 additions and 2 deletions
|
@ -874,7 +874,7 @@ def poster(request, id, size=None):
|
||||||
icon=item.icon.name,
|
icon=item.icon.name,
|
||||||
json=item.get_json()
|
json=item.get_json()
|
||||||
)
|
)
|
||||||
if item.poster:
|
if item.poster and os.path.exists(image.poster.path):
|
||||||
return image_to_response(item.poster, size)
|
return image_to_response(item.poster, size)
|
||||||
else:
|
else:
|
||||||
poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg')
|
poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg')
|
||||||
|
@ -886,7 +886,7 @@ def icon(request, id, size=None):
|
||||||
item = get_object_or_404(models.Item, public_id=id)
|
item = get_object_or_404(models.Item, public_id=id)
|
||||||
if not item.access(request.user):
|
if not item.access(request.user):
|
||||||
return HttpResponseForbidden()
|
return HttpResponseForbidden()
|
||||||
if item.icon:
|
if item.icon and os.path.exists(item.icon.path):
|
||||||
return image_to_response(item.icon, size)
|
return image_to_response(item.icon, size)
|
||||||
else:
|
else:
|
||||||
poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg')
|
poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg')
|
||||||
|
|
Loading…
Reference in a new issue