From 12e08b8cd847d198f19e357f3dda99a4fb658e4e Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Fri, 29 Jul 2022 01:41:29 +0300 Subject: [PATCH] CLI error on missing profile --- ckanext/googleanalytics/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ckanext/googleanalytics/cli.py b/ckanext/googleanalytics/cli.py index ddcd36a..a15078d 100644 --- a/ckanext/googleanalytics/cli.py +++ b/ckanext/googleanalytics/cli.py @@ -49,7 +49,9 @@ def load(credentials, start_date): except TypeError as e: raise Exception("Unable to create a service: {0}".format(e)) profile_id = get_profile_id(service) - + if not profile_id: + tk.error_shout("Unknown Profile ID. `googleanalytics.profile_id` or `googleanalytics.account` must be specified") + raise click.Abort() if start_date: bulk_import(service, profile_id, start_date) else: