# HG changeset patch # User Brian Neal # Date 1261286517 0 # Node ID 7ad1f3e77cd9a9803dccf0c5ef05277ff9d41f71 # Parent ef93dc9f19920bc0f434ab36be7b2ae46954504b Messages: use post to delete and undelete messages. diff -r ef93dc9f1992 -r 7ad1f3e77cd9 gpp/messages/views.py --- a/gpp/messages/views.py Sat Dec 19 22:20:09 2009 +0000 +++ b/gpp/messages/views.py Sun Dec 20 05:21:57 2009 +0000 @@ -8,6 +8,7 @@ from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.http import Http404 +from django.views.decorators.http import require_POST from messages.models import Message from messages.models import Options @@ -162,6 +163,7 @@ @login_required +@require_POST def delete(request, msg_id): """ Deletes a given message. The user must be either the sender or @@ -208,6 +210,7 @@ @login_required +@require_POST def undelete(request, msg_id): """ Undeletes a given message. The user must be either the sender or diff -r ef93dc9f1992 -r 7ad1f3e77cd9 gpp/templates/messages/view.html --- a/gpp/templates/messages/view.html Sat Dec 19 22:20:09 2009 +0000 +++ b/gpp/templates/messages/view.html Sun Dec 20 05:21:57 2009 +0000 @@ -20,12 +20,16 @@ {{ msg.sender.get_profile.signature_html|safe }} {% endif %} -

{% if is_deleted %} -Undelete +

+ {% if box %}{% endif %} + +
{% else %} Reply | -Delete +
+ {% if box %}{% endif %} + +
{% endif %} -

{% endblock %}