diff gpp/messages/views.py @ 566:4b9970ad0edb

For bitbucket issue #6, try to improve quoting messages.
author Brian Neal <bgneal@gmail.com>
date Sun, 04 Mar 2012 14:52:24 -0600
parents 33d0c55e57a9
children 7cec8d6f9581
line wrap: on
line diff
--- a/gpp/messages/views.py	Sun Mar 04 13:20:40 2012 -0600
+++ b/gpp/messages/views.py	Sun Mar 04 14:52:24 2012 -0600
@@ -12,15 +12,15 @@
 from django.http import HttpResponse
 from django.http import HttpResponseForbidden
 from django.http import HttpResponseNotAllowed
-from django.http import HttpResponseRedirect
 from django.shortcuts import get_object_or_404
 from django.shortcuts import render
 import django.utils.simplejson as json
 
 from messages.models import Message, Options
 from messages.forms import OptionsForm, ComposeForm
-from messages.utils import reply_subject, quote_message
+from messages.utils import reply_subject
 from messages import MSG_BOX_LIMIT
+from core.functions import quote_message
 
 
 MSGS_PER_PAGE = 20      # message pagination value
@@ -98,7 +98,7 @@
     paginator = Paginator(msg_list, MSGS_PER_PAGE)
     try:
         msgs = paginator.page(_get_page(request))
-    except EmptyPage, InvalidPage:
+    except (EmptyPage, InvalidPage):
         msgs = paginator.page(paginator.num_pages)
 
     return render(request, 'messages/inbox_tab.html', {
@@ -121,7 +121,7 @@
     paginator = Paginator(msg_list, MSGS_PER_PAGE)
     try:
         msgs = paginator.page(_get_page(request))
-    except EmptyPage, InvalidPage:
+    except (EmptyPage, InvalidPage):
         msgs = paginator.page(paginator.num_pages)
 
     return render(request, 'messages/outbox_tab.html', {
@@ -142,7 +142,7 @@
     paginator = Paginator(msg_list, MSGS_PER_PAGE)
     try:
         msgs = paginator.page(_get_page(request))
-    except EmptyPage, InvalidPage:
+    except (EmptyPage, InvalidPage):
         msgs = paginator.page(paginator.num_pages)
 
     return render(request, 'messages/trash_tab.html', {
@@ -175,8 +175,7 @@
                     receiver=msg.receiver.username,
                     content=msg.html,
                     re_subject=reply_subject(msg.subject),
-                    re_content=quote_message(msg.sender.username, msg.send_date,
-                                             msg.message))
+                    re_content=quote_message(msg.sender.username, msg.message))
 
     result = json.dumps(msg_dict, ensure_ascii=False)
     return HttpResponse(result, content_type='application/json')