Commit fac84695 authored by Michal Čihař's avatar Michal Čihař

Do not forget search filter on adding comment

Fixes #408
parent 9b9bbfcb
......@@ -670,4 +670,4 @@ def comment(request, pk):
else:
messages.error(request, _('Failed to add comment!'))
return redirect(translation)
return redirect(request.POST.get('next', translation))
......@@ -252,6 +252,7 @@
{% if perms.trans.add_comment %}
<form method="post" action="{% url 'comment' pk=unit.id %}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ this_unit_url }}" />
{{ comment_form.comment }}
<br />
<input class="button" type="submit" value="{% trans "Add" %}" />
......@@ -285,6 +286,7 @@
<form method="post" action="{% url 'comment' pk=unit.id %}">
{% csrf_token %}
<input type="hidden" name="type" value="source" />
<input type="hidden" name="next" value="{{ this_unit_url }}" />
{{ comment_form.comment }}
<br />
<input class="button" type="submit" value="{% trans "Add" %}" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment