populate_db: Be a little more defensive about message types.

(imported from commit fe23365180847065a9a3292f7873dcb36bb277db)
This commit is contained in:
Tim Abbott 2012-10-20 19:48:05 -04:00
parent 55d9c08c83
commit dab25bdff7
1 changed files with 3 additions and 1 deletions

View File

@ -294,13 +294,15 @@ def restore_saved_messages():
if u["email"] not in email_set:
user_set.add((u["email"], u["full_name"], u["short_name"]))
email_set.add(u["email"])
else:
elif old_message['type'] == 'huddle':
for u in old_message["recipient"]:
user_set.add((u["email"], u["full_name"], u["short_name"]))
if u["email"] not in email_set:
user_set.add((u["email"], u["full_name"], u["short_name"]))
email_set.add(u["email"])
huddle_user_set.add(tuple(sorted(u["email"] for u in old_message["recipient"])))
else:
raise
stream_recipients = {}
user_recipients = {}