If other huddle recipients don't exist, make them.

(imported from commit 5b9d8faf67657dd2ecca117aef136bc2a03f4abf)
This commit is contained in:
Tim Abbott 2012-09-21 17:19:58 -04:00
parent 76c1dfc1ed
commit 1c03419cbf

View File

@ -188,8 +188,18 @@ def forge_zephyr(request):
if huddle_val in huddle_dedup:
# This is a duplicate huddle message, deduplicate!
return json_success()
else:
huddle_dedup[huddle_val] = True
huddle_dedup[huddle_val] = True
# Now confirm all the other recipients exist in our system
for user_email in request.POST["recipient"].split(","):
try:
User.objects.get(email=user_email)
except User.DoesNotExist:
# forge a user for this person
create_user(user_email, "test", user_profile.realm,
user_email.split('@')[0],
user_email.split('@')[0])
return zephyr_backend(request, user)