Skip to content

Commit

Permalink
fix comment ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Akasch committed Dec 26, 2019
1 parent 7bf306c commit b0cd774
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bitpoll/poll/templates/poll/poll.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@
<a href="{% url 'poll_export_csv' poll.url %}">{% trans 'Export as CSV' %}</a>
</div>

<br/><br/>{% if poll.comment_set.all %}<h1 class="print-only">{% trans 'Comments' %}</h1>{% endif %}
<br/><br/>{% if comments %}<h1 class="print-only">{% trans 'Comments' %}</h1>{% endif %}
<div class="comments">
{% for comment in poll.comment_set.all %}
{% for comment in comments %}
<div class="comment">
<div class="meta">
<div class="author">{% if comment.user %}{{ comment.user.get_displayname }}{% else %}{{ comment.name }}{% endif %}</div>
Expand Down
1 change: 1 addition & 0 deletions bitpoll/poll/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def poll(request, poll_url: str, export: bool=False):
'invitations': invitations if current_poll.show_invitations else [],
'summary': summary,
'comment_form': CommentForm(),
'comments': current_poll.comment_set.order_by('date_created'),
'choice_values': ChoiceValue.objects.filter(poll=current_poll),
'spam_challenge': create_anti_spam_challenge(current_poll.id),
})
Expand Down

0 comments on commit b0cd774

Please sign in to comment.