PEP8 fixes

This commit is contained in:
Antoine Nguyen
2015-01-13 21:50:51 +01:00
parent 7c01026148
commit 883fda0a18
+5 -2
View File
@@ -1,7 +1,9 @@
# coding: utf-8
from django.db import connection
from django.conf import settings
from django.db import connection
from django.utils.translation import ugettext as _
from modoboa.lib.exceptions import InternalError
@@ -33,7 +35,8 @@ def db_type(cname="default"):
:return: a string or None
"""
if not cname in settings.DATABASES:
raise InternalError(_("Connection to database %s not configured" % cname))
raise InternalError(
_("Connection to database %s not configured" % cname))
for t in ['postgres', 'mysql', 'sqlite']:
if settings.DATABASES[cname]['ENGINE'].find(t) != -1:
return t