Skip to content

Commit

Permalink
[#3366] paster: tolerate missing system_info table
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Dec 15, 2016
1 parent 0512b22 commit 29f67ef
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ckan/model/system_info.py
Expand Up @@ -53,11 +53,15 @@ def __init__(self, key, value):

def get_system_info(key, default=None):
''' get data from system_info table '''
obj = meta.Session.query(SystemInfo).filter_by(key=key).first()
if obj:
return obj.value
else:
return default
from sqlalchemy.exc import ProgrammingError
try:
obj = meta.Session.query(SystemInfo).filter_by(key=key).first()
if obj:
return obj.value
except ProgrammingError:
meta.Session.rollback()
return default



def delete_system_info(key, default=None):
Expand Down

0 comments on commit 29f67ef

Please sign in to comment.