src/pyams_content/workflow/task.py
changeset 400 d319362746d1
parent 277 9649f8ce3b1c
child 956 a8723fffbaf6
equal deleted inserted replaced
399:e9d06cb67677 400:d319362746d1
    19 # import interfaces
    19 # import interfaces
    20 from hypatia.interfaces import ICatalog
    20 from hypatia.interfaces import ICatalog
    21 from pyams_content.shared.common.interfaces import IBaseSharedTool
    21 from pyams_content.shared.common.interfaces import IBaseSharedTool
    22 from pyams_content.workflow.interfaces import IContentArchiverTask
    22 from pyams_content.workflow.interfaces import IContentArchiverTask
    23 from pyams_i18n.interfaces import II18n
    23 from pyams_i18n.interfaces import II18n
       
    24 from pyams_security.interfaces import INTERNAL_USER_ID
    24 from pyams_sequence.interfaces import ISequentialIdInfo
    25 from pyams_sequence.interfaces import ISequentialIdInfo
    25 from pyams_workflow.interfaces import IWorkflow, IWorkflowInfo
    26 from pyams_workflow.interfaces import IWorkflow, IWorkflowInfo
    26 from zope.intid.interfaces import IIntIds
    27 from zope.intid.interfaces import IIntIds
    27 
    28 
    28 # import packages
    29 # import packages
    61                     report.write(translate(_("Automatic contents withdrawal:\n")))
    62                     report.write(translate(_("Automatic contents withdrawal:\n")))
    62                     has_retired = True
    63                     has_retired = True
    63                 info = IWorkflowInfo(content)
    64                 info = IWorkflowInfo(content)
    64                 info.fire_transition_toward(workflow.auto_retired_state,
    65                 info.fire_transition_toward(workflow.auto_retired_state,
    65                                             check_security=False,
    66                                             check_security=False,
    66                                             principal='system:internal')
    67                                             principal=INTERNAL_USER_ID)
    67                 info.fire_automatic()
    68                 info.fire_automatic()
    68                 report.write("- {0} ({1})\n".format(II18n(content).query_attribute('title', request=request),
    69                 report.write("- {0} ({1})\n".format(II18n(content).query_attribute('title', request=request),
    69                                                     ISequentialIdInfo(content).hex_oid))
    70                                                     ISequentialIdInfo(content).hex_oid))