From 9f5d2867f51a488bc60465786c55b461a2195e94 Mon Sep 17 00:00:00 2001 From: tomtom5152 Date: Sat, 28 Mar 2015 19:56:46 +0000 Subject: [PATCH] Bug fix with not oppening the connection --- importer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/importer.py b/importer.py index 91c0e5ad..41b2bafd 100644 --- a/importer.py +++ b/importer.py @@ -6,7 +6,7 @@ import django django.setup() -from django.db import connections +from django.db import connection, connections from django.core.exceptions import ObjectDoesNotExist from django.db.utils import ConnectionDoesNotExist from django.db import transaction @@ -16,6 +16,9 @@ import datetime import uuid from multiprocessing import Process +# Slight fix for needing to restablish the connection +connection.close() + def fix_email(email): if not (email is None or email is "") and ("@" not in email): email += "@nottingham.ac.uk"