Commit 12cfe195 authored by Michal Čihař's avatar Michal Čihař

Raise Machine translation exceptions in debug mode

This makes it easier to debug issues.
parent 378ad290
...@@ -22,6 +22,7 @@ Base code for machine translation services. ...@@ -22,6 +22,7 @@ Base code for machine translation services.
''' '''
from django.core.cache import cache from django.core.cache import cache
from django.conf import settings
import json import json
import urllib import urllib
import urllib2 import urllib2
...@@ -144,6 +145,7 @@ class MachineTranslation(object): ...@@ -144,6 +145,7 @@ class MachineTranslation(object):
self.name, self.name,
str(exc) str(exc)
) )
if settings.DEBUG:
raise raise
return self.default_languages return self.default_languages
...@@ -174,4 +176,6 @@ class MachineTranslation(object): ...@@ -174,4 +176,6 @@ class MachineTranslation(object):
self.name, self.name,
str(exc) str(exc)
) )
if settings.DEBUG:
raise
return [] return []
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment