Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ckanext/versions/logic/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

from ckanext.versions.model import Version

# CKAN 2.10+ moved Activity to a separate module
# CKAN 2.10+ Activity is in core_model, older versions in separate module
try:
from ckan.model.activity import Activity
except ImportError:
except (ImportError, ModuleNotFoundError):
Activity = core_model.Activity

log = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions ckanext/versions/logic/dataset_version_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from ckanext.versions.logic.action import version_show
from ckanext.versions.model import Version

# CKAN 2.10+ moved Activity to a separate module
# CKAN 2.10+ Activity is in core_model, older versions in separate module
try:
from ckan.model.activity import Activity
except ImportError:
except (ImportError, ModuleNotFoundError):
Activity = core_model.Activity

log = logging.getLogger(__name__)
Expand Down
4 changes: 3 additions & 1 deletion ckanext/versions/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ def tables_exist():
if engine is None:
return False
return Version.__table__.exists(bind=engine)
except (AttributeError, TypeError):
except Exception:
# Catch all exceptions during database initialization
# This can happen when CKAN core tables don't exist yet
return False