Fix #154. Bind actual func to the button. (#217)

* Fix #154. Bind actual func to the button.
This commit is contained in:
cryptogun 2018-01-31 01:03:19 +08:00 committed by Esteban Castro Borsani
parent 4acd90d192
commit ff5c9fe3bb
2 changed files with 6 additions and 2 deletions

View File

@ -51,7 +51,11 @@
</div>
<ul class="comment-actions">
<li><a href="#">{% trans "delete" %}</a></li>
{% if not flag.comment.is_removed %}
<li><a class="js-post" href="{% url "spirit:comment:delete" flag.comment.pk %}?next={% firstof request.get_full_path|urlencode '/' %}">{% trans "delete" %}</a></li>
{% else %}
<li><a class="js-post" href="{% url "spirit:comment:undelete" flag.comment.pk %}?next={% firstof request.get_full_path|urlencode '/' %}">{% trans "undelete" %}</a></li>
{% endif %}
</ul>
</div>

View File

@ -90,7 +90,7 @@ def delete(request, pk, remove=True):
.filter(pk=pk)\
.update(is_removed=remove)
return redirect(comment.get_absolute_url())
return redirect(request.GET.get('next', comment.get_absolute_url()))
context = {'comment': comment, }