Commit c347ddd2 authored by Michal Čihař's avatar Michal Čihař

Catch operational error as well (non existing table)

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent b9f7670e
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from django.db import models from django.db import models, transaction
from django.db import transaction from django.db.utils import OperationalError
from django.utils.translation import ugettext as _, ugettext_lazy from django.utils.translation import ugettext as _, ugettext_lazy
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.dispatch import receiver from django.dispatch import receiver
...@@ -71,7 +71,7 @@ def get_english_lang(): ...@@ -71,7 +71,7 @@ def get_english_lang():
"""Returns object ID for English language""" """Returns object ID for English language"""
try: try:
return Language.objects.get_default().id return Language.objects.get_default().id
except Language.DoesNotExist: except (Language.DoesNotExist, OperationalError):
return None return None
......
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