Changeset 8335 for main


Ignore:
Timestamp:
3 May 2012, 20:53:09 (13 years ago)
Author:
Henrik Bettermann
Message:

Move initial workflow transition to handle_applicant_added. This way we can avoid misleading duplicate log entries.

Roll back changes in workflow.py.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py

    r8311 r8335  
    4545        super(Applicant, self).__init__()
    4646        self.password = None
    47         IWorkflowInfo(self).fireTransition('init')
    4847        self.application_date = None
    4948        self.applicant_id = None
     
    307306    role_manager.assignRoleToPrincipal(
    308307        'waeup.Applicant', applicant.applicant_id)
     308    IWorkflowInfo(applicant).fireTransition('init')
    309309
    310310    # Assign global applicant role for new applicant (alternative way)
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r8334 r8335  
    307307            'date_of_birth=1990-01-04, email=xx@yy.zz' in
    308308            logcontent)
     309        # Logging message from handle_applicant_transition_event
     310        self.assertTrue(
     311            'dp2011_1234 - Application initialized' in
     312            logcontent)
    309313        shutil.rmtree(os.path.dirname(fin_file))
    310314
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py

    r8334 r8335  
    170170    history.addMessage(msg)
    171171    # In some tests we don't have a an applicants root or a user
    172     if event.transition.transition_id != 'init':
    173         try:
    174             applicants_root = grok.getSite()['applicants']
    175             applicants_root.logger.info('%s - %s' % (obj.applicant_id,msg))
    176         except (TypeError, AttributeError):
    177             pass
     172    try:
     173        applicants_root = grok.getSite()['applicants']
     174        applicants_root.logger.info('%s - %s' % (obj.applicant_id,msg))
     175    except (TypeError, AttributeError):
     176        pass
    178177    return
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py

    r8334 r8335  
    302302        obj = context
    303303        if isinstance(context, basestring):
    304             # If we log initialization transitions this
    305             # will create another (misleading) log entry
     304            # If we log initialization transitions in the __init__
     305            # method of objects, a second (misleading) log entry
     306            # will be created here.
    306307            obj = createObject(context)
    307308
Note: See TracChangeset for help on using the changeset viewer.