Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortal committed Jul 30, 2017
1 parent 8b238e3 commit 152b6c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tutormail/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from emailtunnel import SMTPForwarder, Message, InvalidRecipient
from emailtunnel.mailhole import MailholeRelayMixin

import django.db
from django.db import connection

import mftutor.settings

Expand Down Expand Up @@ -79,7 +79,7 @@ def handle_envelope(self, envelope, peer):

try:
result = super(TutorForwarder, self).handle_envelope(envelope, peer)
django.db.connection.close()
connection.close()
return result
except ForwardToAdmin as e:
self.forward_to_admin(envelope, e.args[0])
Expand Down Expand Up @@ -120,7 +120,6 @@ def get_groups(self, recipient):
logging.exception("resolve_alias raised an exception - " +
"reconnecting to the database and trying again")
# https://code.djangoproject.com/ticket/21597#comment:29
from django.db import connection
connection.close()
group_names = resolve_alias(recipient)
groups = []
Expand Down

0 comments on commit 152b6c1

Please sign in to comment.