From 31a12185f6c2536677b6d16e7e3f1a27a585236b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 5 Nov 2016 16:15:41 -0400 Subject: [PATCH] more fixes --- contrib/frontends/django/nntpchan/nntpchan/frontend/models.py | 4 ++-- .../django/nntpchan/nntpchan/templates/frontend/board.html | 4 ++-- .../django/nntpchan/nntpchan/templates/frontend/thread.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/frontends/django/nntpchan/nntpchan/frontend/models.py b/contrib/frontends/django/nntpchan/nntpchan/frontend/models.py index 0597a0f..29b9759 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/frontend/models.py +++ b/contrib/frontends/django/nntpchan/nntpchan/frontend/models.py @@ -18,7 +18,7 @@ class Attachment(models.Model): def path(self): ext = self.filename.split('.')[-1] - return '{}{}'.format(self.filehash, ext) + return '{}.{}'.format(self.filehash, ext) def thumb(self): return '/media/thumb-{}.jpg'.format(self.path()) @@ -66,7 +66,7 @@ class Post(models.Model): rpls = self.get_all_replies() l = len(rpls) if l > truncate: - rpls = rpls[(l+1)-truncate:l-1] + rpls = rpls[l-truncate:] return rpls def is_op(self): diff --git a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/board.html b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/board.html index 7cd6937..b45fc8e 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/board.html +++ b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/board.html @@ -16,7 +16,7 @@
{% for a in op.attachments.all %} - + {% endfor %}
{{op.message|memepost}}
@@ -31,7 +31,7 @@
{% for a in reply.attachments.all %} - + {% endfor %}
{{reply.message|memepost}}
diff --git a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/thread.html b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/thread.html index c7f1939..8e28f92 100644 --- a/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/thread.html +++ b/contrib/frontends/django/nntpchan/nntpchan/templates/frontend/thread.html @@ -13,7 +13,7 @@
{% for a in op.attachments.all %} - + {% endfor %}
{{op.message|memepost}}
@@ -28,7 +28,7 @@
{% for a in reply.attachments.all %} - + {% endfor %}
{% autoescape off %}