From 670163babf60dd37e270f3655a8f753c77706736 Mon Sep 17 00:00:00 2001 From: Luca Bellenghi Date: Fri, 6 Sep 2024 10:20:53 +0200 Subject: [PATCH] update code with comments --- src/design/plone/contenttypes/restapi/serializers/dxfields.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/design/plone/contenttypes/restapi/serializers/dxfields.py b/src/design/plone/contenttypes/restapi/serializers/dxfields.py index 1e83e64e..1f8ce119 100644 --- a/src/design/plone/contenttypes/restapi/serializers/dxfields.py +++ b/src/design/plone/contenttypes/restapi/serializers/dxfields.py @@ -198,6 +198,9 @@ def __call__(self): match = RESOLVEUID_RE.match(path) if match: uid, suffix = match.groups() + # We made this check 'cause DTD asks to avoid an unauthorized page, + # just for the "unauthorized" label on it. If the user is anonymous, + # we redirect him to the login page; /login has a more friendly message if api.user.is_anonymous(): target = uuidToObject(uid, unrestricted=True) value = target.absolute_url()