Esempio n. 1
0
 def _addNewVersion(self, comment=''):
     """Content must be updated, so the history machinery will save a new version"""
     context = self.context
     context.reindexObject()
     if VERSIONING_SUPPORT and isObjectChanged(
             context) and isObjectVersioned(context):
         maybeSaveVersion(context, comment=comment)
Esempio n. 2
0
    def __call__(self):
        context = aq_inner(self.context)
        pf = getToolByName(context, 'portal_factory')

        if pf.isTemporary(context):
            # don't do anything if we're in the factory
            return self.success()

        comment = _("Initial revision")

        if isObjectVersioned(context):
            return self.success()

        try:
            maybeSaveVersion(context, comment=comment, force=False)
        except FileTooLargeToVersionError:
            pass # the on edit save will emit a warning

        return self.success()
 def _addNewVersion(self, comment=''):
     """Content must be updated, so the history machinery will save a new version"""
     context = self.context
     context.reindexObject()
     if VERSIONING_SUPPORT and isObjectChanged(context) and isObjectVersioned(context):
         maybeSaveVersion(context, comment=comment)
Esempio n. 4
0
 def _createNewVersion(self, obj):
     _ = getToolByName(self.context, 'translation_service').utranslate
     if isObjectChanged(obj) and isObjectVersioned(obj):
         maybeSaveVersion(obj, comment=_(msgid="Bulk text replacement",
                                         domain="rt.bulkmodify",
                                         context=obj))