Skip to content

Commit

Permalink
Merge branch '2029-no-site-user-during-migration'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 21, 2014
2 parents b455441 + 948586d commit 479be73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ckan/lib/cli.py
Expand Up @@ -135,7 +135,7 @@ def _get_config(self):
fileConfig(self.filename)
return appconfig('config:' + self.filename)

def _load_config(self):
def _load_config(self, load_site_user=True):
conf = self._get_config()
assert 'ckan' not in dir() # otherwise loggers would be disabled
# We have now loaded the config. Now we can import ckan for the
Expand All @@ -149,7 +149,7 @@ def _load_config(self):
self.translator_obj = MockTranslator()
self.registry.register(pylons.translator, self.translator_obj)

if model.user_table.exists():
if model.user_table.exists() and load_site_user:
# If the DB has already been initialized, create and register
# a pylons context object, and add the site user to it, so the
# auth works as in a normal web request
Expand Down Expand Up @@ -199,11 +199,12 @@ class ManageDb(CkanCommand):
min_args = 1

def command(self):
self._load_config()
cmd = self.args[0]

self._load_config(cmd!='upgrade')
import ckan.model as model
import ckan.lib.search as search

cmd = self.args[0]
if cmd == 'init':

model.repo.init_db()
Expand Down

0 comments on commit 479be73

Please sign in to comment.