diff messages/forms.py @ 814:999a71b81111

Private messages refactor: test inbox/outbox limits.
author Brian Neal <bgneal@gmail.com>
date Tue, 09 Sep 2014 20:07:55 -0500
parents 4a4fa174a0ec
children 21c592cac71c
line wrap: on
line diff
--- a/messages/forms.py	Mon Sep 08 20:50:37 2014 -0500
+++ b/messages/forms.py	Tue Sep 09 20:07:55 2014 -0500
@@ -11,8 +11,8 @@
 
 from core.functions import send_mail
 from core.widgets import AutoCompleteUserInput
+import messages
 from messages.models import Flag, Message, Options
-from messages import MSG_BOX_LIMIT
 
 
 # Maximum size of a private message in characters
@@ -62,13 +62,13 @@
             # Can we send a message? Is our outbox full?
 
             count = Message.objects.outbox(self.user).count()
-            if count >= MSG_BOX_LIMIT:
+            if count >= messages.MSG_BOX_LIMIT:
                 raise forms.ValidationError(
                         "Your outbox is full. Please delete some messages.")
 
             # Is the receiver's inbox full?
             count = Message.objects.inbox(self.rcvr_user).count()
-            if count >= MSG_BOX_LIMIT:
+            if count >= messages.MSG_BOX_LIMIT:
                 raise forms.ValidationError(
                     "Sorry, %s's inbox is full. This message cannot be sent." %
                     self.rcvr_user.username)