diff --git a/ckan/cli/less.py b/ckan/cli/less.py index 20945716a9e..28667f60dd4 100644 --- a/ckan/cli/less.py +++ b/ckan/cli/less.py @@ -61,7 +61,7 @@ def less(): directory = output[0].strip() if not directory: error_shout(u'Command "{}" returned nothing. Check that npm is ' - u'installed.'.format(' '.join(command))) + u'installed.'.format(u' '.join(command))) less_bin = os.path.join(directory, u'lessc') public = config.get(u'ckan.base_public_folder') diff --git a/ckan/cli/tracking.py b/ckan/cli/tracking.py index 73a1f6de653..f7a6c13000b 100644 --- a/ckan/cli/tracking.py +++ b/ckan/cli/tracking.py @@ -145,7 +145,8 @@ def update_tracking(engine, summary_date): sql = u'''UPDATE tracking_summary t SET package_id = COALESCE( (SELECT id FROM package p - WHERE p.name = regexp_replace(' ' || t.url, '^[ ]{1}(/\w{2}){0,1}' || %s, '')) + WHERE p.name = regexp_replace + (' ' || t.url, '^[ ]{1}(/\\w{2}){0,1}' || %s, '')) ,'~~not~found~~') WHERE t.package_id IS NULL AND tracking_type = 'page';''' @@ -202,8 +203,8 @@ def update_tracking_solr(engine, start_date): total = len(package_ids) not_found = 0 - click.echo('{} package index{} to be rebuilt starting from {}'.format( - total, '' if total < 2 else 'es', start_date) + click.echo(u'{} package index{} to be rebuilt starting from {}'.format( + total, u'' if total < 2 else u'es', start_date) ) from ckan.lib.search import rebuild