populate_db: Close database connections before shutting down.

This avoids some messages being logged by the postgres server.

(imported from commit 86aaa025a36dad6ec14d49b629cfb1ec326f929c)
This commit is contained in:
Tim Abbott 2012-12-13 13:42:03 -05:00
parent e330be7fc1
commit 434765d810
1 changed files with 2 additions and 0 deletions

View File

@ -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