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/browser.py

    r6321 r6322  
    7676TRANSITION_OBJECTS = create_workflow()
    7777
    78 TRANSITION_DICT = dict([
    79     (transition_object.transition_id,transition_object.title)
    80     for transition_object in TRANSITION_OBJECTS])
     78#TRANSITION_DICT = dict([
     79#    (transition_object.transition_id,transition_object.title)
     80#    for transition_object in TRANSITION_OBJECTS])
    8181
    8282class ApplicantsRootPage(WAeUPPage):
     
    419419        if state == INITIALIZED:
    420420            IWorkflowInfo(self.context[pin]).fireTransition('start')
    421             timestamp = datetime.now().strftime("%d/%m/%Y %H:%M")
    422             transition_title = TRANSITION_DICT['start']
    423             self.context[pin].messages += '<br />%s - %s' % (
    424                 timestamp,transition_title)
    425421        self.redirect(self.url(self.context[pin], 'edit'))
    426422        return
     
    496492    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    497493    grok.template('form_edit')
     494    manage_applications = True
    498495    pnav = 3
    499496
     
    551548    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    552549    grok.template('form_edit')
     550    manage_applications = False
     551
    553552
    554553    def emitLockMessage(self):
     
    566565
    567566    def dataNotComplete(self):
    568         if self.context.confirm_passport is not True:
     567        #import pdb; pdb.set_trace()
     568        if not self.request.form.get('confirm_passport', False):
    569569            return 'Passport confirmation box not ticked.'
    570570        if len(self.errors) > 0:
     
    572572        return False
    573573
    574     @property
    575     def getTransitions(self):
    576         return None
    577 
    578574    @grok.action('Save')
    579575    def save(self, **data):
     
    597593            return
    598594        state = IWorkflowState(self.context).getState()
    599         # Cannot happen but anyway ...
     595        # This shouldn't happen, but the application officer
     596        # might have forgotten to lock the form after changing the state
    600597        if state != STARTED:
    601             self.flash('This form cannot be submitted.')
     598            self.flash('This form cannot be submitted. Wrong state!')
    602599            return
    603600        IWorkflowInfo(self.context).fireTransition('submit')
Note: See TracChangeset for help on using the changeset viewer.