Skip to content

Commit

Permalink
better check for working copy support: test for feature instead of te…
Browse files Browse the repository at this point in the history
…sting for version
  • Loading branch information
davisagli committed Jan 25, 2025
1 parent f008f0c commit 152ffc2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/plone/restapi/serializer/dxcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from plone.dexterity.interfaces import IDexterityContainer
from plone.dexterity.interfaces import IDexterityContent
from plone.dexterity.utils import iterSchemata
from plone.restapi import HAS_PLONE_6
from plone.restapi.batching import HypermediaBatch
from plone.restapi.bbb import base_hasattr
from plone.restapi.deserializer import boolean_value
Expand Down Expand Up @@ -47,12 +46,12 @@ def update_with_working_copy_info(context, result):
if WorkingCopyInfo is None:
return

# Does not return working copy information when serializing Portal in Plone 5.2.
if not HAS_PLONE_6 and context.portal_type == "Plone Site":
return

working_copy_info = WorkingCopyInfo(context)
baseline, working_copy = working_copy_info.get_working_copy_info()
try:
baseline, working_copy = working_copy_info.get_working_copy_info()
except TypeError:
# not supported for this content type
return
result.update({"working_copy": working_copy, "working_copy_of": baseline})


Expand Down

0 comments on commit 152ffc2

Please sign in to comment.