Bug fix with not oppening the connection

This commit is contained in:
tomtom5152
2015-03-28 19:56:46 +00:00
parent 24ed32e7cb
commit ca7aeee3e1

View File

@@ -6,7 +6,7 @@ import django
django.setup() django.setup()
from django.db import connections from django.db import connection, connections
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.db.utils import ConnectionDoesNotExist from django.db.utils import ConnectionDoesNotExist
from django.db import transaction from django.db import transaction
@@ -16,6 +16,9 @@ import datetime
import uuid import uuid
from multiprocessing import Process from multiprocessing import Process
# Slight fix for needing to restablish the connection
connection.close()
def fix_email(email): def fix_email(email):
if not (email is None or email is "") and ("@" not in email): if not (email is None or email is "") and ("@" not in email):
email += "@nottingham.ac.uk" email += "@nottingham.ac.uk"