From 2cf4072b210749e20d786dafc0e63bb58f38becf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Ignacio=20S=C3=A1nchez=20Lara?= Date: Wed, 8 Nov 2017 10:42:10 +0100 Subject: [PATCH] Support for multiple parameters at client (such as channel) --- .../cartodb_services/google/geocoder.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/google/geocoder.py b/server/lib/python/cartodb_services/cartodb_services/google/geocoder.py index bf14b84..c3ecd80 100644 --- a/server/lib/python/cartodb_services/cartodb_services/google/geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/google/geocoder.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import googlemaps +import re from exceptions import MalformedResult from client_factory import GoogleMapsClientFactory @@ -48,4 +49,11 @@ class GoogleMapsGeocoder: def _clean_client_id(self, client_id): # Consistency with how the client_id is saved in metadata - return client_id.replace('client=', '') + if client_id is None: + return '' + else: + search_result = re.search(r'client=([^&]*).*', client_id) + if search_result is None: + return client_id + else: + return search_result.group(1)