From a3a2cf5e16f51870955107dce909ef94f43b404c Mon Sep 17 00:00:00 2001 From: plan Date: Fri, 24 Jul 2015 01:34:45 +0800 Subject: [PATCH 1/2] fix picture resource sync exception --- everpad/provider/sync/note.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/everpad/provider/sync/note.py b/everpad/provider/sync/note.py index 3881cb8..68000ee 100644 --- a/everpad/provider/sync/note.py +++ b/everpad/provider/sync/note.py @@ -267,6 +267,9 @@ def _receive_resources(self, note, note_ttype): resources_ids = [] for resource_ttype in note_ttype.resources or []: + if resource_ttype.data.size and not resource_ttype.data.body: + resource_ttype = self.note_store.getResource(self.auth_token, + guid=resource_ttype.guid, withData=True, withRecognition=True, withAttributes=True) try: resource = self.session.query(models.Resource).filter( models.Resource.guid == resource_ttype.guid, @@ -285,7 +288,6 @@ def _receive_resources(self, note, note_ttype): self.session.add(resource) self.session.commit() resources_ids.append(resource.id) - return resources_ids def _remove_resources(self, note, resources_ids): From d83285025d697ab453f0084f18c4809a2ae617ae Mon Sep 17 00:00:00 2001 From: plan Date: Wed, 12 Aug 2015 23:33:52 +0800 Subject: [PATCH 2/2] fix --- everpad/provider/sync/note.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/everpad/provider/sync/note.py b/everpad/provider/sync/note.py index 68000ee..f593ac8 100644 --- a/everpad/provider/sync/note.py +++ b/everpad/provider/sync/note.py @@ -269,7 +269,7 @@ def _receive_resources(self, note, note_ttype): for resource_ttype in note_ttype.resources or []: if resource_ttype.data.size and not resource_ttype.data.body: resource_ttype = self.note_store.getResource(self.auth_token, - guid=resource_ttype.guid, withData=True, withRecognition=True, withAttributes=True) + guid=resource_ttype.guid, withData=True, withRecognition=True, withAttributes=True, withAlternateData=False) try: resource = self.session.query(models.Resource).filter( models.Resource.guid == resource_ttype.guid,