From 434765d81085a777cd74e9acea3b050e6eb5fee3 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 13 Dec 2012 13:42:03 -0500 Subject: [PATCH] populate_db: Close database connections before shutting down. This avoids some messages being logged by the postgres server. (imported from commit 86aaa025a36dad6ec14d49b629cfb1ec326f929c) --- zephyr/management/commands/populate_db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zephyr/management/commands/populate_db.py b/zephyr/management/commands/populate_db.py index f3c3e906b0..8828925cf9 100644 --- a/zephyr/management/commands/populate_db.py +++ b/zephyr/management/commands/populate_db.py @@ -223,6 +223,7 @@ class Command(BaseCommand): self.stdout.write("Successfully populated test database.\n") if options["replay_old_messages"]: restore_saved_messages() + connection.close() recipient_hash = {} def get_recipient_by_id(rid): @@ -730,4 +731,5 @@ def send_messages(data): recipients[num_messages] = [message_type, message.recipient.id, saved_data] num_messages += 1 + connection.close() return tot_messages