aboutsummaryrefslogtreecommitdiff
path: root/ignis
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-01-25 22:47:08 -0500
committerBobby <[email protected]>2023-01-25 22:47:08 -0500
commitdd77735e0c54a1dc75d52d840db58277c6599214 (patch)
tree55502b0689ac55b513c31b9a000a12217790073e /ignis
parentee8f1599c31562cef00e570479c8b546f50b05aa (diff)
downloadthatcomputerscientist-dd77735e0c54a1dc75d52d840db58277c6599214.tar.xz
thatcomputerscientist-dd77735e0c54a1dc75d52d840db58277c6599214.zip
Huge breaking changes to post_admin, see commit details
Diffstat (limited to 'ignis')
-rw-r--r--ignis/models.py2
-rw-r--r--ignis/views.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/ignis/models.py b/ignis/models.py
index dd8443bc..e89cc83d 100644
--- a/ignis/models.py
+++ b/ignis/models.py
@@ -11,7 +11,7 @@ class CoverImage(models.Model):
post = models.ForeignKey(Post, default=None, on_delete=models.CASCADE, null=True)
def __str__(self):
- return self.name
+ return str(self.name)
class PostImage(models.Model):
post = models.ForeignKey(Post, default=None, on_delete=models.CASCADE, null=True)
diff --git a/ignis/views.py b/ignis/views.py
index 164e6637..b198b4f5 100644
--- a/ignis/views.py
+++ b/ignis/views.py
@@ -36,12 +36,12 @@ def tex(request):
@csrf_exempt
def post_image(request, size, post_id):
post_id = post_id.replace('.gif', '')
- pi = CoverImage.objects.filter(post=Post.objects.get(id=post_id))
+ pi = Post.objects.get(id=post_id)
if not pi:
return HttpResponse('No image found!', status=404)
# open image and return
- image = pi[0].image
+ image = pi.post_image
with open(image.path, 'rb') as f:
# resize image
size = int(size)