From 2be66f0e8a0382bec0d4b2f3c586bc4eb76ea93b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 8 Nov 2012 17:13:09 -0500 Subject: [PATCH] populate_db: Don't create huddles with 2 copies of the same person in them. Bug caught by our new unique_together constraints. (imported from commit 37c1fc459b98050417e907653a5a4fc97004903b) --- zephyr/management/commands/populate_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/management/commands/populate_db.py b/zephyr/management/commands/populate_db.py index 0b1bd0508d..6e09b91eb4 100644 --- a/zephyr/management/commands/populate_db.py +++ b/zephyr/management/commands/populate_db.py @@ -316,7 +316,7 @@ def restore_saved_messages(): if u["email"] not in email_set: user_set.add((u["email"], u["full_name"], u["short_name"], False)) email_set.add(u["email"]) - huddle_user_set.add(tuple(sorted(u["email"] for u in old_message["recipient"]))) + huddle_user_set.add(tuple(sorted(set(u["email"] for u in old_message["recipient"])))) else: raise ValueError('Bad message type')