Skip to content

Commit

Permalink
Make sure that the modified header value is always a string
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbiber committed Aug 23, 2016
1 parent 6a8d0d6 commit aa537d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyzotero/zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def update_collection(self, payload):
"""
modified = payload['version']
key = payload['key']
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.put(
url=self.endpoint
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def update_item(self, payload):
to_send = self.check_items([payload])[0]
modified = payload['version']
ident = payload['key']
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.put(
url=self.endpoint
Expand All @@ -1065,7 +1065,7 @@ def addto_collection(self, collection, payload):
modified = payload['version']
# add the collection data from the item
modified_collections = payload['data']['collections'] + [collection]
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.patch(
url=self.endpoint
Expand All @@ -1092,7 +1092,7 @@ def deletefrom_collection(self, collection, payload):
# strip the collection data from the item
modified_collections = [
c for c in payload['data']['collections'] if c != collection]
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.patch(
url=self.endpoint
Expand Down Expand Up @@ -1159,7 +1159,7 @@ def delete_item(self, payload):
t=self.library_type,
u=self.library_id,
c=ident)
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.delete(
url=url,
Expand Down Expand Up @@ -1195,7 +1195,7 @@ def delete_collection(self, payload):
t=self.library_type,
u=self.library_id,
c=ident)
headers = {'If-Unmodified-Since-Version': modified}
headers = {'If-Unmodified-Since-Version': str(modified)}
headers.update(self.default_headers())
req = requests.delete(
url=url,
Expand Down

0 comments on commit aa537d7

Please sign in to comment.