Skip to content

Commit

Permalink
Fix up migration for earlier versions of CKAN
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Feb 15, 2019
1 parent 90cc300 commit 90bf945
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ckan/migration/migrate_package_activity.py
Expand Up @@ -167,7 +167,20 @@ def wipe_activity_detail():
u'dataset - specify its name')
args = parser.parse_args()
assert args.config, u'You must supply a --config'
from ckan.lib.cli import load_config
try:
from ckan.lib.cli import load_config
except ImportError:
# for CKAN 2.6 and earlier
def load_config(config):
from ckan.lib.cli import CkanCommand
cmd = CkanCommand(name=None)
class Options(object):
pass
cmd.options = Options()
cmd.options.config = config
cmd._load_config()
return

print(u'Loading config')
load_config(args.config)
if not args.dataset:
Expand Down

0 comments on commit 90bf945

Please sign in to comment.