Ignore:
Timestamp:
13 Dec 2014, 08:58:43 (10 years ago)
Author:
Henrik Bettermann
Message:

Let's take the 'last transition date' from the history. Saving the date is redundant.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/documents
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py

    r12204 r12210  
    8686    def formatted_transition_date(self):
    8787        try:
    88             return self.last_transition_date.strftime('%Y-%m-%d %H:%M:%S')
    89         except AttributeError:
     88            return self.history.messages[-1].split(' - ')[0]
     89        except IndexError:
    9090            return
    9191
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py

    r12200 r12210  
    5454        )
    5555
    56     last_transition_date = schema.Datetime(
    57         title = _(u'Last Transition Date'),
    58         required = False,
    59         readonly = False,
    60         )
    61 
    6256    def setMD5():
    6357        """Determine md5 checksum of selected files and store checksums as
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py

    r12200 r12210  
    134134@grok.subscribe(IDocument, IWorkflowTransitionEvent)
    135135def handle_document_transition_event(obj, event):
    136     """Append message to document history and log file and update
    137     last_transition_date when transition happened.
     136    """Append message to document history and log file.
    138137
    139138    Undo the verification of document and raise an exception if document
     
    151150    history = IObjectHistory(obj)
    152151    history.addMessage(msg)
    153     obj.last_transition_date = datetime.utcnow()
    154152    try:
    155153        customers_container = grok.getSite()['customers']
Note: See TracChangeset for help on using the changeset viewer.