[ckan-changes] [okfn/ckan] 89c2fc: [2302] Fix for test TestDatabaseNotInitialised
GitHub
noreply at github.com
Tue Apr 24 09:52:46 UTC 2012
Branch: refs/heads/feature-2302-simple-theming
Home: https://github.com/okfn/ckan
Commit: 89c2fcd825ebb0d89333e3cb9537a38dedcd4eb5
https://github.com/okfn/ckan/commit/89c2fcd825ebb0d89333e3cb9537a38dedcd4eb5
Author: Ross Jones <rossdjones at gmail.com>
Date: 2012-04-24 (Tue, 24 Apr 2012)
Changed paths:
M ckan/lib/base.py
Log Message:
-----------
[2302] Fix for test TestDatabaseNotInitialised
diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index eece185..ffdfae0 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -155,7 +155,14 @@ class BaseController(WSGIController):
def _apply_settings(self):
# Getting configured settings
- settings = dict( model.Setting.get_values(["name","tagline","image_url"]) )
+ try:
+ settings = dict( model.Setting.get_values(
+ ["name","tagline","image_url"]))
+ except Exception:
+ # During tests, particularly TestDatabaseNotInitialised this
+ # fails here rather than raising a 503 later on
+ model.Session.rollback()
+ return
g.site_title = settings.get("name", config.get('ckan.site_title',''))
g.site_description = \
settings.get("tagline", config.get('ckan.site_description','') )
================================================================
More information about the ckan-changes
mailing list