Workarounds for APIv1 issues
This commit is contained in:
parent
853256cc1f
commit
c4ea338f49
2 changed files with 14 additions and 2 deletions
|
@ -114,6 +114,11 @@ class Photo(OpenPhotoObject):
|
|||
"""
|
||||
new_dict = self._openphoto.post("/photo/%s/transform.json" % self.id,
|
||||
**kwds)["result"]
|
||||
|
||||
# APIv1 doesn't return the transformed photo (frontend issue #955)
|
||||
if isinstance(new_dict, bool):
|
||||
new_dict = self._openphoto.get("/photo/%s/view.json" % self.id)["result"]
|
||||
|
||||
self._replace_fields(new_dict)
|
||||
|
||||
class Tag(OpenPhotoObject):
|
||||
|
@ -173,6 +178,11 @@ class Album(OpenPhotoObject):
|
|||
""" Update this album with the specified parameters """
|
||||
new_dict = self._openphoto.post("/album/%s/update.json" % self.id,
|
||||
**kwds)["result"]
|
||||
|
||||
# APIv1 doesn't return the updated album (frontend issue #937)
|
||||
if isinstance(new_dict, bool):
|
||||
new_dict = self._openphoto.get("/album/%s/view.json" % self.id)["result"]
|
||||
|
||||
self._replace_fields(new_dict)
|
||||
self._update_fields_with_objects()
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import unittest
|
||||
from tests import test_albums, test_photos, test_tags
|
||||
|
||||
class TestAlbumsV1(test_albums.TestAlbums):
|
||||
|
@ -6,5 +7,6 @@ class TestAlbumsV1(test_albums.TestAlbums):
|
|||
class TestPhotosV1(test_photos.TestPhotos):
|
||||
api_version = 1
|
||||
|
||||
class TestTagsV1(test_tags.TestTags):
|
||||
api_version = 1
|
||||
# The tag API didn't work at v1 - see frontend issue #927
|
||||
# class TestTagsV1(test_tags.TestTags):
|
||||
# api_version = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue