From 3feb7e7f7fe2aa9e2566c18ae3491ab30275424b Mon Sep 17 00:00:00 2001 From: kmbn Date: Tue, 25 Jul 2017 14:56:40 +0200 Subject: [PATCH] Fix variable referenced before assignment error --- ckanext/googleanalytics/ga_auth.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ckanext/googleanalytics/ga_auth.py b/ckanext/googleanalytics/ga_auth.py index c85e5de..c13d1e6 100644 --- a/ckanext/googleanalytics/ga_auth.py +++ b/ckanext/googleanalytics/ga_auth.py @@ -51,14 +51,14 @@ def get_profile_id(service): if acc.get('name') == accountName: accountId = acc.get('id') - # TODO: check, whether next line is doing something useful. - webproperties = service.management().webproperties().list( - accountId=accountId).execute() + # TODO: check, whether next line is doing something useful. + webproperties = service.management().webproperties().list( + accountId=accountId).execute() - profiles = service.management().profiles().list( - accountId=accountId, webPropertyId=webPropertyId).execute() + profiles = service.management().profiles().list( + accountId=accountId, webPropertyId=webPropertyId).execute() - if profiles.get('items'): - return profiles.get('items')[0].get('id') + if profiles.get('items'): + return profiles.get('items')[0].get('id') return None