diff --git a/openphoto/objects.py b/openphoto/objects.py index 589bbec..155c711 100644 --- a/openphoto/objects.py +++ b/openphoto/objects.py @@ -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() diff --git a/tests/api_versions/test_v1.py b/tests/api_versions/test_v1.py index 92baabb..46b9091 100644 --- a/tests/api_versions/test_v1.py +++ b/tests/api_versions/test_v1.py @@ -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