Update delete endpoints to return True if successful.

If the operation isn't successful, the API returns an error code,
which raises an OpenPhotoError exception.
This commit is contained in:
Pete 2013-04-09 18:18:12 +01:00
parent 306c8430ba
commit e09f166743
7 changed files with 60 additions and 24 deletions

View file

@ -20,10 +20,14 @@ class ApiTag:
return Tag(self._client, result)
def delete(self, tag, **kwds):
""" Delete a tag """
"""
Delete a tag.
Returns True if successful.
Raises an OpenPhotoError if not.
"""
if not isinstance(tag, Tag):
tag = Tag(self._client, {"id": tag})
tag.delete(**kwds)
return tag.delete(**kwds)
def update(self, tag, **kwds):
""" Update a tag """