Changeset 6459 for main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
- Timestamp:
- 23 Jun 2011, 06:25:59 (14 years ago)
- 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
r6455 r6459 139 139 if 'disable' in form: 140 140 try: 141 self.context.disable(entry, self.request.principal.id) 141 comment = u"Disabled by %s" % self.request.principal.id 142 self.context.disable(entry, comment) 142 143 self.flash('%s disabled.' % entry) 143 144 except InvalidTransitionError: … … 145 146 elif 'enable' in form: 146 147 try: 147 self.context.enable(entry, self.request.principal.id) 148 comment = u"Re-enabled by %s" % self.request.principal.id 149 self.context.enable(entry, comment) 148 150 self.flash('%s (re-)enabled.' % entry) 149 151 except InvalidTransitionError: -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py
r6452 r6459 192 192 history = IObjectHistory(self.ac1) 193 193 msgs = history.messages 194 assert msgs[-1].endswith(' - Used (new state: used)')194 assert msgs[-1].endswith('Used by system') 195 195 196 196 class AccessCodeTests(FunctionalTestCase): … … 236 236 # Access codes have a history. 237 237 match = re.match( 238 '^../../.... ..:..:.. - Initialized \(new state: initialized\)',238 '^../../.... ..:..:.. - Initialized by system', 239 239 self.ac1.history) 240 240 assert match is not None -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py
r6425 r6459 121 121 # append message to history 122 122 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S") 123 msg = '%s - %s (new state: %s)' % ( 124 timestamp, event.destination.title(), event.destination) 123 msg = '%s -' % timestamp 125 124 if event.comment is not None: 126 msg = '%s, %s' % (msg, event.comment) 125 msg = '%s %s' % (msg, event.comment) 126 else: 127 msg = '%s %s by system' % (msg,event.destination.title()) 128 127 129 history = IObjectHistory(obj) 128 130 history.addMessage(msg)
Note: See TracChangeset for help on using the changeset viewer.