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

Produce more user friendly and shorter object history messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py

    r6355 r6471  
    2222        source = None,
    2323        condition = NullCondition,
    24         msg = 'application process initialized',
     24        msg = 'Application initialized',
    2525        destination = INITIALIZED),
    2626
     
    2828        transition_id = 'start',
    2929        title = 'Start application',
    30         msg = 'application process started',
     30        msg = 'Application started',
    3131        source = INITIALIZED,
    3232        destination = STARTED),
     
    3535        transition_id = 'submit',
    3636        title = 'Submit application',
    37         msg = 'application record submitted',
     37        msg = 'Application submitted',
    3838        source = STARTED,
    3939        destination = SUBMITTED),
     
    4242        transition_id = 'admit',
    4343        title = 'Admit applicant',
    44         msg = 'applicant admitted',
     44        msg = 'Applicant admitted',
    4545        source = SUBMITTED,
    4646        destination = ADMITTED),
     
    4949        transition_id = 'refuse1',
    5050        title = 'Refuse application',
    51         msg = 'application refused',
     51        msg = 'Application refused',
    5252        source = SUBMITTED,
    5353        destination = NOT_ADMITTED),
     
    5656        transition_id = 'refuse2',
    5757        title = 'Refuse application',
    58         msg = 'application refused',
     58        msg = 'Application refused',
    5959        source = ADMITTED,
    6060        destination = NOT_ADMITTED),
     
    6363        transition_id = 'create',
    6464        title = 'Create student record',
    65         msg = 'student record created',
     65        msg = 'Student record created',
    6666        source = ADMITTED,
    6767        destination = CREATED),
     
    7070        transition_id = 'reset1',
    7171        title = 'Reset application',
    72         msg = 'application record reset',
     72        msg = 'Application reset',
    7373        source = SUBMITTED,
    7474        destination = STARTED),
     
    7777        transition_id = 'reset2',
    7878        title = 'Reset application',
    79         msg = 'application record reset',
     79        msg = 'Application reset',
    8080        source = ADMITTED,
    8181        destination = STARTED),
     
    8484        transition_id = 'reset3',
    8585        title = 'Reset application',
    86         msg = 'application record reset',
     86        msg = 'Application reset',
    8787        source = NOT_ADMITTED,
    8888        destination = STARTED),
     
    9191        transition_id = 'reset4',
    9292        title = 'Reset application',
    93         msg = 'application record reset',
     93        msg = 'Application reset',
    9494        source = CREATED,
    9595        destination = STARTED),
     
    119119@grok.subscribe(IApplicantBaseData, IWorkflowTransitionEvent)
    120120def handle_applicant_transition_event(obj, event):
    121     """Append message to applicant when transition happened.
     121    """Append message to applicant history when transition happened.
    122122    """
    123     timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
    124     msg = '%s - %s (new state: %s)' % (
    125         timestamp, event.transition.user_data['msg'], event.destination)
     123    msg = '%s' % event.transition.user_data['msg']
    126124    history = IObjectHistory(obj)
    127125    history.addMessage(msg)
Note: See TracChangeset for help on using the changeset viewer.