Skip to content

Commit

Permalink
Does not return working copy information when serializing Portal in
Browse files Browse the repository at this point in the history
Plone 5.2
  • Loading branch information
wesleybl committed Dec 17, 2024
1 parent 504fbb1 commit 88ca99e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/plone/restapi/serializer/dxcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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.deserializer import boolean_value
from plone.restapi.interfaces import IFieldSerializer
Expand Down Expand Up @@ -43,9 +44,16 @@


def update_with_working_copy_info(context, result):
if WorkingCopyInfo is not None:
baseline, working_copy = WorkingCopyInfo(context).get_working_copy_info()
result.update({"working_copy": working_copy, "working_copy_of": baseline})
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()
result.update({"working_copy": working_copy, "working_copy_of": baseline})


def get_allow_discussion_value(context, request, result):
Expand Down

0 comments on commit 88ca99e

Please sign in to comment.