From 8f04d13d9eb3bb1d0d4ad160463b44463d6c0ed9 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Thu, 2 Nov 2023 17:11:00 +0100 Subject: [PATCH] Fix issue that happens before the site is upgraded --- collective/auditlog/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collective/auditlog/utils.py b/collective/auditlog/utils.py index a60046c..9f49f3d 100644 --- a/collective/auditlog/utils.py +++ b/collective/auditlog/utils.py @@ -42,7 +42,12 @@ def getUID(context): return uid if hasattr(context, "UID"): - return context.UID() + try: + return context.UID() + except TypeError: + # Happens when running Plone 6 code before running + # the migration steps from Plone 5 to Plone6 + pass try: return "/".join(context.getPhysicalPath())