comparison 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
comparison
equal deleted inserted replaced
429:d0f0800eef0c 430:9df368d9775d
37 receiver = self.cleaned_data['receiver'] 37 receiver = self.cleaned_data['receiver']
38 try: 38 try:
39 self.rcvr_user = User.objects.get(username=receiver) 39 self.rcvr_user = User.objects.get(username=receiver)
40 except User.DoesNotExist: 40 except User.DoesNotExist:
41 raise forms.ValidationError("That username does not exist.") 41 raise forms.ValidationError("That username does not exist.")
42 if self.user.username.lower() == receiver.lower(): 42 if self.user == self.rcvr_user:
43 raise forms.ValidationError("You can't send a message to yourself.") 43 raise forms.ValidationError("You can't send a message to yourself.")
44 return receiver 44 return receiver
45 45
46 def save(self, sender, parent_msg=None): 46 def save(self, parent_msg=None):
47 sender = self.user
47 receiver = self.rcvr_user 48 receiver = self.rcvr_user
48 subject = self.cleaned_data['subject'] 49 subject = self.cleaned_data['subject']
49 message = self.cleaned_data['message'] 50 message = self.cleaned_data['message']
50 attach_signature = self.cleaned_data['attach_signature'] 51 attach_signature = self.cleaned_data['attach_signature']
51 52