Ignore:
Timestamp:
10 Jun 2011, 06:58:09 (13 years ago)
Author:
Henrik Bettermann
Message:
  • Use user_data attribute to display more appropriate workflow messages.
  • confirm_passport must not be an attribute of Applicant. Use confirm_passport only in form to allow submission.
  • application_state must not be an attribute of Applicant.
File:
1 edited

Legend:

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

    r6318 r6322  
    2525        source = None,
    2626        condition = NullCondition,
     27        msg = 'appplication process initialized',
    2728        destination = INITIALIZED)
    2829
     
    3031        transition_id = 'start',
    3132        title = 'Start application',
     33        msg = 'appplication process started',
    3234        source = INITIALIZED,
    3335        destination = STARTED)
     
    3638        transition_id = 'submit',
    3739        title = 'Submit application',
     40        msg = 'appplication record submitted',
    3841        source = STARTED,
    3942        destination = SUBMITTED)
     
    4245        transition_id = 'admit',
    4346        title = 'Admit applicant',
     47        msg = 'appplicant admitted',
    4448        source = SUBMITTED,
    4549        destination = ADMITTED)
     
    4852        transition_id = 'refuse1',
    4953        title = 'Refuse application',
     54        msg = 'appplication refused',
    5055        source = SUBMITTED,
    5156        destination = NOT_ADMITTED)
     
    5459        transition_id = 'refuse2',
    5560        title = 'Refuse application',
     61        msg = 'appplication refused',
    5662        source = ADMITTED,
    5763        destination = NOT_ADMITTED)
     
    6066        transition_id = 'create',
    6167        title = 'Create student record',
     68        msg = 'student record created',
    6269        source = ADMITTED,
    6370        destination = CREATED)
     
    6673        transition_id = 'reset1',
    6774        title = 'Reset application',
     75        msg = 'appplication record reset',
    6876        source = SUBMITTED,
    6977        destination = STARTED)
     
    7280        transition_id = 'reset2',
    7381        title = 'Reset application',
     82        msg = 'appplication record reset',
    7483        source = ADMITTED,
    7584        destination = STARTED)
     
    7887        transition_id = 'reset3',
    7988        title = 'Reset application',
     89        msg = 'appplication record reset',
    8090        source = NOT_ADMITTED,
    8191        destination = STARTED)
     
    8494        transition_id = 'reset4',
    8595        title = 'Reset application',
     96        msg = 'appplication record reset',
    8697        source = CREATED,
    8798        destination = STARTED)
     
    161172    """
    162173    timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
    163     comment = event.comment or '(no comment)'
    164174    # XXX: `messages` is meta data which shouldn't really be part of
    165175    #      the Applicant class. Furthermore we should not store HTML
     
    169179    #      to finetune transitions instead of doing that manually in
    170180    #      UI stuff.
    171     msg = '%s - %s to %s: %s: %s' % (
    172         timestamp, event.source, event.destination, event.transition.title,
    173         comment)
     181    msg = '%s - %s (new state: %s)' % (
     182        timestamp, event.transition.user_data['msg'], event.destination)
    174183    msgs = getattr(obj, 'messages', None)
    175     if msgs != '':
     184    if msgs:
    176185        msgs += '<br />'
    177     obj.messages += msg
     186        msgs += msg
     187    else:
     188        msgs = msg
     189    obj.messages = msgs
    178190    return
Note: See TracChangeset for help on using the changeset viewer.