Skip to content

Commit

Permalink
Write message as manager
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed May 13, 2024
1 parent b013abf commit 514fb80
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from functools import wraps

from Products.CMFCore.utils import getToolByName
from plone import api

from redturtle.prenotazioni import _

Expand All @@ -17,8 +18,9 @@ def get_booking_folder_notification_flags(booking_folder):

def write_message_to_object_history(object, message):
"""Write a message to object versioning history"""
pr = getToolByName(object, "portal_repository")
pr.save(object, message)
with api.env.adopt_roles(["Manager"]):
pr = getToolByName(object, "portal_repository")
pr.save(object, message)


def notify_the_message_failure(func, gateway_type=""):
Expand Down

0 comments on commit 514fb80

Please sign in to comment.