Changeset 6644 for main/waeup.sirp/trunk
- Timestamp:
- 28 Aug 2011, 20:05:42 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6622 r6644 762 762 self.flash('Form has been saved.') 763 763 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 764 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 764 if fields_string: 765 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 765 766 return 766 767 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py
r6471 r6644 8 8 from waeup.sirp.interfaces import IObjectHistory, IWAeUPWorkflowInfo 9 9 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo 10 from waeup.sirp.utils.helpers import get_current_principal 10 11 11 12 INITIALIZED = 'initialized' … … 124 125 history = IObjectHistory(obj) 125 126 history.addMessage(msg) 127 # In some tests we don't have a an applicants root or a user 128 try: 129 user = get_current_principal() 130 applicants_root = grok.getSite()['applicants'] 131 applicants_root.logger.info('%s - %s - %s' % (user.id,obj.access_code,msg)) 132 except (TypeError, AttributeError): 133 pass 126 134 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6642 r6644 309 309 self.flash('Form has been saved.') 310 310 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 311 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 311 if fields_string: 312 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 312 313 return 313 314 -
main/waeup.sirp/trunk/src/waeup/sirp/students/container.py
r6642 r6644 58 58 logger_filename = 'students.log' 59 59 60 def logger_info(self, target, ob_class, comment=None):60 def logger_info(self, ob_class, target, comment=None): 61 61 """Get the logger's info method. 62 62 """ … … 67 67 user = user.id 68 68 self.logger.info('%s - %s - %s - %s' % ( 69 user, target, ob_class, comment))69 user, ob_class, target, comment)) 70 70 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py
r6638 r6644 8 8 from waeup.sirp.interfaces import IObjectHistory, IWAeUPWorkflowInfo 9 9 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo 10 from waeup.sirp.utils.helpers import get_current_principal 10 11 11 12 CREATED = 'created' … … 59 60 @grok.subscribe(IStudent, IWorkflowTransitionEvent) 60 61 def handle_student_transition_event(obj, event): 61 """Append message to student history when transition happened.62 """Append message to student history and log file when transition happened. 62 63 """ 63 64 msg = '%s' % event.transition.user_data['msg'] 64 65 history = IObjectHistory(obj) 65 66 history.addMessage(msg) 67 # In some tests we don't have a students container or a user 68 try: 69 user = get_current_principal() 70 students_container = grok.getSite()['students'] 71 students_container.logger.info('%s - %s - %s' % (user.id,obj.student_id,msg)) 72 except (TypeError, AttributeError): 73 pass 66 74 return
Note: See TracChangeset for help on using the changeset viewer.