From dfec191a9a7c4548157361c82a274d3473d91128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Ignacio=20S=C3=A1nchez=20Lara?= Date: Thu, 3 Sep 2015 16:51:06 +0200 Subject: [PATCH] Support for spaces inside group names, fixed --- scripts-available/CDB_Groups_API.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts-available/CDB_Groups_API.sql b/scripts-available/CDB_Groups_API.sql index 70f185c..2b83400 100644 --- a/scripts-available/CDB_Groups_API.sql +++ b/scripts-available/CDB_Groups_API.sql @@ -25,7 +25,7 @@ $$ import string import urllib - url = '/api/v1/databases/%s/groups/%s' % ('%s', urllib.quote_plus(group_name)) + url = '/api/v1/databases/%s/groups/%s' % ('%s', urllib.quote(group_name)) query = "select cartodb._CDB_Group_API_Request('DELETE', '%s', '', '{200, 404}') as response_status" % url plpy.execute(query) $$ LANGUAGE 'plpythonu' VOLATILE SECURITY DEFINER; @@ -50,7 +50,7 @@ $$ import string import urllib - url = '/api/v1/databases/%s/groups/%s/users' % ('%s', urllib.quote_plus(group_name)) + url = '/api/v1/databases/%s/groups/%s/users' % ('%s', urllib.quote(group_name)) body = '{ "username": "%s" }' % username query = "select cartodb._CDB_Group_API_Request('POST', '%s', '%s', '{200, 409}') as response_status" % (url, body) plpy.execute(query) @@ -63,7 +63,7 @@ $$ import string import urllib - url = '/api/v1/databases/%s/groups/%s/users/%s' % ('%s', urllib.quote_plus(group_name), username) + url = '/api/v1/databases/%s/groups/%s/users/%s' % ('%s', urllib.quote(group_name), username) query = "select cartodb._CDB_Group_API_Request('DELETE', '%s', '', '{200, 404}') as response_status" % url plpy.execute(query) $$ LANGUAGE 'plpythonu' VOLATILE SECURITY DEFINER; @@ -83,7 +83,7 @@ $$ import string import urllib - url = '/api/v1/databases/%s/groups/%s/permission/%s/tables/%s' % ('%s', urllib.quote_plus(group_name), username, table_name) + url = '/api/v1/databases/%s/groups/%s/permission/%s/tables/%s' % ('%s', urllib.quote(group_name), username, table_name) body = '{ "access": "%s" }' % access query = "select cartodb._CDB_Group_API_Request('PUT', '%s', '%s', '{200, 409}') as response_status" % (url, body) plpy.execute(query) @@ -104,7 +104,7 @@ $$ import string import urllib - url = '/api/v1/databases/%s/groups/%s/permission/%s/tables/%s' % ('%s', urllib.quote_plus(group_name), username, table_name) + url = '/api/v1/databases/%s/groups/%s/permission/%s/tables/%s' % ('%s', urllib.quote(group_name), username, table_name) query = "select cartodb._CDB_Group_API_Request('DELETE', '%s', '', '{200, 404}') as response_status" % url plpy.execute(query) $$ LANGUAGE 'plpythonu' VOLATILE SECURITY DEFINER;