From dab25bdff79f58175b6702c8d00f1c24cd20040f Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 20 Oct 2012 19:48:05 -0400 Subject: [PATCH] populate_db: Be a little more defensive about message types. (imported from commit fe23365180847065a9a3292f7873dcb36bb277db) --- zephyr/management/commands/populate_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zephyr/management/commands/populate_db.py b/zephyr/management/commands/populate_db.py index 96c4a3cd1f..64b66950b7 100644 --- a/zephyr/management/commands/populate_db.py +++ b/zephyr/management/commands/populate_db.py @@ -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 = {}