Clarify comments about huddles.

(imported from commit b4b779c48289e0f78490c0e93ece19b55a6f2dee)
This commit is contained in:
Tim Abbott 2012-09-05 11:19:03 -04:00
parent 08b55de0af
commit fe43dc008f

View File

@ -130,9 +130,10 @@ def zephyr(request):
elif zephyr_type == "personal":
recipient_data = request.POST['recipient']
if ',' in recipient_data:
# This is actually a huddle message
# This is actually a huddle message, which shares the
# "personal" zephyr sending form
recipients = [r.strip() for r in recipient_data.split(',')]
# Filter out any trailing commas
# Ignore any blank recipients
recipients = [r for r in recipients if r]
recipient_ids = [UserProfile.objects.get(user=User.objects.get(username=r)).id
for r in recipients]
@ -142,6 +143,7 @@ def zephyr(request):
huddle = get_huddle(recipient_ids)
recipient = Recipient.objects.get(type_id=huddle.pk, type="huddle")
else:
# This is actually a personal message
if User.objects.filter(username=recipient_data):
recipient_user = User.objects.get(username=recipient_data)
recipient_user_profile = UserProfile.objects.get(user=recipient_user)