Skip to content

Commit

Permalink
check that field to order is provided by OrderedDict
Browse files Browse the repository at this point in the history
  • Loading branch information
nilbacardit26 committed Oct 11, 2023
1 parent 70b2ec5 commit 5770736
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion guillotina/contrib/image/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from guillotina.interfaces.content import IResource
from guillotina.response import HTTPNoContent
from guillotina.response import HTTPNotFound
from guillotina.schema.interfaces import IOrderedDict
from guillotina.utils import get_registry
from guillotina.utils import run_async
from io import BytesIO
Expand Down Expand Up @@ -150,4 +151,5 @@ async def __call__(self):
class OrderMultiImage(TraversableFieldService):
async def __call__(self):
data = await self.request.json()
self.field.reorder_images(data)
if IOrderedDict.providedBy(self.field):
self.field.reorder_images(data)

0 comments on commit 5770736

Please sign in to comment.