diff gpp/messages/forms.py @ 430:9df368d9775d

Fix bug where messages were never getting replied to.
author Brian Neal <bgneal@gmail.com>
date Thu, 05 May 2011 02:58:44 +0000
parents 88b2b9cb8c1f
children ca744075e7b7
line wrap: on
line diff
--- a/gpp/messages/forms.py	Tue May 03 02:56:58 2011 +0000
+++ b/gpp/messages/forms.py	Thu May 05 02:58:44 2011 +0000
@@ -39,11 +39,12 @@
          self.rcvr_user = User.objects.get(username=receiver)
       except User.DoesNotExist:
          raise forms.ValidationError("That username does not exist.")
-      if self.user.username.lower() == receiver.lower():
+      if self.user == self.rcvr_user:
          raise forms.ValidationError("You can't send a message to yourself.")
       return receiver
 
-   def save(self, sender, parent_msg=None):
+   def save(self, parent_msg=None):
+      sender = self.user
       receiver = self.rcvr_user
       subject = self.cleaned_data['subject']
       message = self.cleaned_data['message']