Skip to content

Commit

Permalink
fixed internal checking of cursor_max to skip on nonetype
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jan 13, 2016
1 parent 3d73ce0 commit 80f9eda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion habanero/crossref/crossref.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def licenses(self, query = None, offset = None,
check_kwargs(["ids", "filter", "works"], kwargs)
res = request(self.base_url, "/licenses/", None,
query, None, offset, limit, None, sort,
order, facet, None, **kwargs)
order, facet, None, None, None, None, **kwargs)
return res

def registration_agency(self, ids, **kwargs):
Expand Down
5 changes: 3 additions & 2 deletions habanero/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def request(url, path, ids = None, query = None, filter = None,

url = url + path

if cursor_max.__class__ != int:
raise ValueError("cursor_max must be of class int")
if cursor_max.__class__.__name__ != 'NoneType':
if cursor_max.__class__ != int:
raise ValueError("cursor_max must be of class int")

filt = filter_handler(filter)

Expand Down
5 changes: 3 additions & 2 deletions habanero/request_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def _url(self):
def do_request(self):
filt = filter_handler(self.filter)

if self.cursor_max.__class__ != int:
raise ValueError("cursor_max must be of class int")
if self.cursor_max.__class__.__name__ != 'NoneType':
if self.cursor_max.__class__ != int:
raise ValueError("cursor_max must be of class int")

payload = {'query':self.query, 'filter':filt, 'offset':self.offset,
'rows':self.limit, 'sample':self.sample, 'sort':self.sort,
Expand Down

0 comments on commit 80f9eda

Please sign in to comment.