aboutsummaryrefslogtreecommitdiff
path: root/ignis
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-06-06 18:15:28 +0000
committerBobby <[email protected]>2024-06-06 18:15:28 +0000
commitdebfb4676328d587d31d44cc679c3d382fadd6ed (patch)
tree604fe923a7f2e0971f6a35ec3f33d4328cde6e5e /ignis
parent57d54e24ac6fe72ac8a37236e827914c0dd235ee (diff)
downloadthatcomputerscientist-debfb4676328d587d31d44cc679c3d382fadd6ed.tar.xz
thatcomputerscientist-debfb4676328d587d31d44cc679c3d382fadd6ed.zip
Spam Comments Fix
Diffstat (limited to 'ignis')
-rw-r--r--ignis/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ignis/views.py b/ignis/views.py
index d6bd7faf..942ab187 100644
--- a/ignis/views.py
+++ b/ignis/views.py
@@ -74,7 +74,11 @@ def post_image(request, size, post_id):
@csrf_exempt
def get_image(request, post_id, image_name):
# get image from post_id
- pi = PostImage.objects.filter(post=Post.objects.get(id=post_id), name=image_name)
+ try:
+ post = Post.objects.get(id=post_id)
+ except:
+ return HttpResponse('No post found!', status=404)
+ pi = PostImage.objects.filter(post=post, name=image_name)
if not pi:
return HttpResponse('No image found!', status=404)