mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-15 02:33:13 +00:00
Fix URL names with namespace
This commit is contained in:
parent
0f4514752c
commit
e819de91b5
4 changed files with 8 additions and 8 deletions
|
|
@ -11,7 +11,7 @@
|
|||
<p>
|
||||
{% trans 'Are you sure you want to delete this form submission?' %}
|
||||
</p>
|
||||
<form action="{% url 'wagtailforms_delete_submission' page.id submission.id %}" method="POST">
|
||||
<form action="{% url 'wagtailforms:delete_submission' page.id submission.id %}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="{% trans 'Delete it' %}" class="serious">
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
{% endfor %}
|
||||
<td>
|
||||
<a class="button button-small button-secondary" href="
|
||||
{% url 'wagtailforms_delete_submission' form_page.id row.model_id %}">
|
||||
{% url 'wagtailforms:delete_submission' form_page.id row.model_id %}">
|
||||
delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ class TestDeleteFormSubmission(TestCase):
|
|||
|
||||
def test_delete_submission_show_cofirmation(self):
|
||||
reponse = self.client.get(reverse(
|
||||
'wagtailforms_delete_submission',
|
||||
'wagtailforms:delete_submission',
|
||||
args=(self.form_page.id, FormSubmission.objects.first().id)
|
||||
)
|
||||
)
|
||||
|
|
@ -400,7 +400,7 @@ class TestDeleteFormSubmission(TestCase):
|
|||
|
||||
def test_delete_submission_with_permissions(self):
|
||||
response = self.client.post(reverse(
|
||||
'wagtailforms_delete_submission',
|
||||
'wagtailforms:delete_submission',
|
||||
args=(self.form_page.id, FormSubmission.objects.first().id)
|
||||
)
|
||||
)
|
||||
|
|
@ -408,14 +408,14 @@ class TestDeleteFormSubmission(TestCase):
|
|||
# Check that the submission is gone
|
||||
self.assertEqual(FormSubmission.objects.count(), 1)
|
||||
# Should be redirected to list of submissions
|
||||
self.assertRedirects(response, reverse("wagtailforms_list_submissions", args=(self.form_page.id, )))
|
||||
self.assertRedirects(response, reverse("wagtailforms:list_submissions", args=(self.form_page.id, )))
|
||||
|
||||
def test_delete_submission_bad_permissions(self):
|
||||
self.form_page = make_form_page()
|
||||
self.client.login(username="eventeditor", password="password")
|
||||
|
||||
response = self.client.post(reverse(
|
||||
'wagtailforms_delete_submission',
|
||||
'wagtailforms:delete_submission',
|
||||
args=(self.form_page.id, FormSubmission.objects.first().id)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ def delete_submission(request, page_id, submission_id):
|
|||
submission.delete()
|
||||
|
||||
messages.success(request, _("Submission deleted."))
|
||||
return redirect('wagtailforms_list_submissions', page_id)
|
||||
return redirect('wagtailforms:list_submissions', page_id)
|
||||
|
||||
return render(request, 'wagtailforms/confirm_delete.html', {
|
||||
'page': page,
|
||||
|
|
|
|||
Loading…
Reference in a new issue