コード例 #1
0
    def update(self):
        if (getattr(self.context, "collective_immediatecreate", None) !=
                "initial"  # noqa: W503
            ):
            url = self.context.absolute_url() + "/edit"
            url = addTokenToUrl(url)
            raise Redirect(url)
        self.portal_type = self.context.portal_type

        if ILocking.providedBy(self.context):
            lockable = ILockable(self.context)
            if lockable.locked():
                lockable.unlock()

        super().update()

        # fire the edit begun only if no action was executed
        if len(self.actions.executedActions) == 0:
            notify(EditBegunEvent(self.context))
コード例 #2
0
 def test_locking_behavior(self):
     self.assertTrue(ILocking.providedBy(self.c1))
コード例 #3
0
 def test_locking_behavior(self):
     self.assertTrue(ILocking.providedBy(self.cover))