Skip to content

Commit

Permalink
[#4041] fix variable redefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Feb 25, 2018
1 parent a34e8a0 commit fe359de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ckanext/datastore/logic/action.py
Expand Up @@ -173,13 +173,15 @@ def datastore_create(context, data_dict):
result = data_dict
else:
result = backend.create(context, data_dict)

except InvalidDataError as err:
raise p.toolkit.ValidationError(unicode(err))

# Set the datastore_active flag on the resource if necessary
if resource.extras.get('datastore_active') is not True:
model = _get_or_bust(context, 'model')
resobj = model.Resource.get(data_dict['resource_id'])
if resobj.extras.get('datastore_active') is not True:
log.debug(
'Setting datastore_active=True on resource {0}'.format(resource.id)
'Setting datastore_active=True on resource {0}'.format(resobj.id)
)
set_datastore_active_flag(model, data_dict, True)

Expand Down

0 comments on commit fe359de

Please sign in to comment.