Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that the modified header value is always a string #61

Merged
merged 1 commit into from Aug 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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