Skip to content

Commit

Permalink
Merge branch '1123-paster-db-clean-fix'
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/config/environment.py
  • Loading branch information
joetsoi committed Jul 31, 2013
2 parents 6f44db7 + e60c59e commit 24ca402
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ckan/config/environment.py
Expand Up @@ -373,3 +373,6 @@ def template_loaded(template):
except sqlalchemy.exc.InternalError:
# The database is not initialised. Travis hits this
pass
# if an extension or our code does not finish
# transaction properly db cli commands can fail
model.Session.remove()
5 changes: 3 additions & 2 deletions ckan/logic/action/get.py
Expand Up @@ -1846,8 +1846,9 @@ def get_site_user(context, data_dict):
user.sysadmin = True
model.Session.add(user)
model.Session.flush()
if not context.get('defer_commit'):
model.Session.commit()
if not context.get('defer_commit'):
model.repo.commit_and_remove()

return {'name': user.name,
'apikey': user.apikey}

Expand Down

0 comments on commit 24ca402

Please sign in to comment.