Ensure db connection is closed before script exits
authorMagnus Hagander <magnus@hagander.net>
Mon, 25 Nov 2013 18:40:31 +0000 (19:40 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 25 Nov 2013 18:41:01 +0000 (19:41 +0100)
This is required in django 1.4, but was closed automatically back
in 1.2 when it was created.

tools/moderation/moderation_report.py

index 2fbcd59d0b26269667a3908f83c8b1241d40093b..b78147c5085b54971c63d40ff5f27e9d977c1989 100755 (executable)
@@ -9,6 +9,8 @@ sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '../
 import settings
 setup_environ(settings)
 
+from django.db import connection
+
 from util.moderation import get_all_pending_moderations
 from util.misc import send_template_mail
 
@@ -22,3 +24,5 @@ if len(counts):
                                           {
                        'items': counts,
                        })
+
+connection.close()