Skip to content

Commit

Permalink
Merge branch '2007-datastore-active-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 21, 2014
2 parents ed23158 + 3b87cc0 commit 2af578c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckanext/datastore/plugin.py
Expand Up @@ -273,6 +273,9 @@ def before_show(self, resource_dict):
action='dump', resource_id=resource_dict['id'])

connection = None

resource_dict['datastore_active'] = False

try:
connection = self.read_engine.connect()
result = connection.execute(
Expand All @@ -281,8 +284,6 @@ def before_show(self, resource_dict):
).fetchone()
if result:
resource_dict['datastore_active'] = True
else:
resource_dict['datastore_active'] = False
finally:
if connection:
connection.close()
Expand Down

0 comments on commit 2af578c

Please sign in to comment.