from plone import api
from Products.Five import BrowserView


class RedirectToAcceptDeclineLinkView(BrowserView):
    def __call__(self):
        portal_url = api.portal.get().absolute_url()
        uid = self.context.UID()
        self.request.response.redirect(
            f"{portal_url}/apps/calendar/@@app-calendar?shared-event-uid={uid}"
        )
