Ignore:
Timestamp:
23 Jun 2011, 15:29:31 (14 years ago)
Author:
Henrik Bettermann
Message:

Produce more user friendly and shorter object history messages.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.py

    r6459 r6471  
    139139            if 'disable' in form:
    140140                try:
    141                     comment = u"Disabled by %s" % self.request.principal.id
     141                    comment = u"AC disabled"
    142142                    self.context.disable(entry, comment)
    143143                    self.flash('%s disabled.' % entry)
     
    146146            elif 'enable' in form:
    147147                try:
    148                     comment = u"Re-enabled by %s" % self.request.principal.id
     148                    comment = u"AC re-enabled"
    149149                    self.context.enable(entry, comment)
    150150                    self.flash('%s (re-)enabled.' % entry)
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py

    r6470 r6471  
    192192        history = IObjectHistory(self.ac1)
    193193        msgs = history.messages
    194         assert msgs[-1].endswith('Used by system')
     194        assert msgs[-1].endswith('AC used by system')
    195195
    196196class AccessCodeTests(FunctionalTestCase):
     
    236236        # Access codes have a history.
    237237        match = re.match(
    238             '^../../.... ..:..:.. - Initialized by system',
     238            '^....-..-.. ..:..:.. - AC initialized by system',
    239239            self.ac1.history)
    240240        assert match is not None
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py

    r6459 r6471  
    120120def handle_accesscode_transition_event(obj, event):
    121121    # append message to history
    122     timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
    123     msg = '%s -' % timestamp
    124122    if event.comment is not None:
    125         msg = '%s %s' % (msg, event.comment)
     123        msg = '%s' % event.comment
    126124    else:
    127         msg = '%s %s by system' % (msg,event.destination.title())
     125        msg = 'AC %s' % event.destination
    128126
    129127    history = IObjectHistory(obj)
Note: See TracChangeset for help on using the changeset viewer.