From 4ea81449aa1f7c0e034ed726f1928371423752c9 Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Tue, 2 Feb 2021 10:20:03 +0100 Subject: [PATCH] Create default params --- viringo/services/datacite.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/viringo/services/datacite.py b/viringo/services/datacite.py index 0e34ce7..084db6d 100644 --- a/viringo/services/datacite.py +++ b/viringo/services/datacite.py @@ -359,14 +359,16 @@ def api_get_paging_with_url(url, params): def api_call_get(url, params=None): """Make authenticated get request to API with params""" + if not params: + params = {} + params['disable-facets'] = True payload_str = '' - if params: - # Construct the payload as a string - # to avoid direct urlencoding by requests library which messes up some of the params - payload_str = "&".join("%s=%s" % (k, v) - for k, v in params.items() if v is not None) + # Construct the payload as a string + # to avoid direct urlencoding by requests library which messes up some of the params + payload_str = "&".join("%s=%s" % (k, v) + for k, v in params.items() if v is not None) response = requests.get( url,