Merge pull request #462 from the5fire/master

fix the puzzle try..catch in contrib.django.models's get_client
This commit is contained in:
David Cramer 2014-06-22 21:33:09 -07:00
commit 6db3ee3918
1 changed files with 2 additions and 1 deletions

View File

@ -142,7 +142,7 @@ def get_client(client=None):
class_name = str(class_name)
try:
instance = getattr(__import__(module, {}, {}, class_name), class_name)(**options)
Client = getattr(__import__(module, {}, {}, class_name), class_name)
except ImportError:
logger.exception('Failed to import client: %s', client)
if not _client[1]:
@ -150,6 +150,7 @@ def get_client(client=None):
client = 'raven.contrib.django.DjangoClient'
_client = (client, get_client(client))
else:
instance = Client(**options)
if not tmp_client:
_client = (client, instance)
return instance