diff --git a/apps/history/api.py b/apps/history/api.py index b15e15a13f..1e4dbf48b2 100644 --- a/apps/history/api.py +++ b/apps/history/api.py @@ -7,6 +7,7 @@ except ImportError: class OperationalError(Exception): pass +from django.core.exceptions import ImproperlyConfigured from django.db import transaction from django.db.utils import DatabaseError #from django.utils import simplejson @@ -38,7 +39,7 @@ def register_history_type(history_type_dict): except DatabaseError: transaction.rollback() # Special case for ./manage.py syncdb - except OperationalError: + except (OperationalError, ImproperlyConfigured): transaction.rollback() # Special for DjangoZoom, which executes collectstatic media # doing syncdb and creating the database tables diff --git a/apps/ocr/__init__.py b/apps/ocr/__init__.py index 42d691f7df..209b23145a 100644 --- a/apps/ocr/__init__.py +++ b/apps/ocr/__init__.py @@ -3,7 +3,8 @@ try: except ImportError: class OperationalError(Exception): pass - + +from django.core.exceptions import ImproperlyConfigured from django.db import transaction from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext @@ -82,7 +83,7 @@ def create_default_queue(): except DatabaseError: transaction.rollback() # Special case for ./manage.py syncdb - except OperationalError: + except (OperationalError, ImproperlyConfigured): transaction.rollback() # Special for DjangoZoom, which executes collectstatic media # doing syncdb and creating the database tables diff --git a/apps/permissions/api.py b/apps/permissions/api.py index d2a860ebc7..13efbbed28 100644 --- a/apps/permissions/api.py +++ b/apps/permissions/api.py @@ -4,6 +4,7 @@ except ImportError: class OperationalError(Exception): pass +from django.core.exceptions import ImproperlyConfigured from django.db import transaction from django.db.utils import DatabaseError from django.shortcuts import get_object_or_404 @@ -36,7 +37,7 @@ def register_permission(permission): except DatabaseError: transaction.rollback() # Special case for ./manage.py syncdb - except OperationalError: + except (OperationalError, ImproperlyConfigured): transaction.rollback() # Special for DjangoZoom, which executes collectstatic media # doing syncdb and creating the database tables