From e796d847df0492391b1e7bde84fb564e49b75f79 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 19 Nov 2020 21:17:45 -0500 Subject: added prologue to essays and a special catchall to stop some persistant spam. --- app/lib/django_comments/views/comments.py | 13 +++++++------ app/posts/templates/posts/essay_detail.html | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/lib/django_comments/views/comments.py b/app/lib/django_comments/views/comments.py index 40dfc60..22e061c 100644 --- a/app/lib/django_comments/views/comments.py +++ b/app/lib/django_comments/views/comments.py @@ -123,12 +123,13 @@ def post_comment(request, next=None, using=None): "comment_will_be_posted receiver %r killed the comment" % receiver.__name__) # Save the comment and signal that it was saved - comment.save() - signals.comment_was_posted.send( - sender=comment.__class__, - comment=comment, - request=request - ) + if comment.user != 'HenryLom': + comment.save() + signals.comment_was_posted.send( + sender=comment.__class__, + comment=comment, + request=request + ) return next_redirect(request, fallback=next or 'comments-comment-done', c=comment._get_pk_val()) diff --git a/app/posts/templates/posts/essay_detail.html b/app/posts/templates/posts/essay_detail.html index 23619d0..e95c161 100644 --- a/app/posts/templates/posts/essay_detail.html +++ b/app/posts/templates/posts/essay_detail.html @@ -47,8 +47,8 @@
- {% if object.preamble %}
- {{object.preamble_html|smartypants|safe}} + {% if object.prologue_html %}
+ {{object.prologue_html|smartypants|safe}}
{%endif%} {{object.body_html|safe|smartypants}}
-- cgit v1.2.3-70-g09d2