Commit 0c70e367 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update BAseStore and MsgCollection to fix issue in last search URL

parent 60be8e09
......@@ -21,6 +21,7 @@ class MsgCollection(Storage):
title of the collection.
def __init__(self, error="", found=0, title="", url=""):
self.error = error
......@@ -29,11 +30,19 @@ class MsgCollection(Storage):
self.url = url
def url_hb(self):
"""URL configured to return a list of record in readable format.
an URL configures to return a list of record
sin readable format.
return self.url.replace("of=id", "of=hb")
url = self.url
# remove list of id constraints
# store
if "of=id" in url:
return url.replace("of=id", "of=hb")
# new inspirehep store
if "&fields=recid" in url:
return url.replace("&fields=recid", "").replace("/api/", "/")
......@@ -148,11 +148,11 @@ class BaseStore(object):
something went wrong within the HTTP dialog
self._url = url
r = self._session.get(url, timeout=timeout, params=kwargs)
self._url = r.url
return r
def last_search_url(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment