diff options
| author | Bobby <[email protected]> | 2024-06-06 18:15:28 +0000 |
|---|---|---|
| committer | Bobby <[email protected]> | 2024-06-06 18:15:28 +0000 |
| commit | debfb4676328d587d31d44cc679c3d382fadd6ed (patch) | |
| tree | 604fe923a7f2e0971f6a35ec3f33d4328cde6e5e /ignis/views.py | |
| parent | 57d54e24ac6fe72ac8a37236e827914c0dd235ee (diff) | |
| download | thatcomputerscientist-debfb4676328d587d31d44cc679c3d382fadd6ed.tar.xz thatcomputerscientist-debfb4676328d587d31d44cc679c3d382fadd6ed.zip | |
Spam Comments Fix
Diffstat (limited to 'ignis/views.py')
| -rw-r--r-- | ignis/views.py | 6 |
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) |
