Changeset 8286


Ignore:
Timestamp:
26 Apr 2012, 13:58:25 (13 years ago)
Author:
Henrik Bettermann
Message:

Roll back r8282. Also in students the registration state is simply called state.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
6 edited

Legend:

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

    r8285 r8286  
    5454
    5555    @property
    56     def app_state(self):
     56    def state(self):
    5757        return IWorkflowState(self).getState()
    5858
    5959    @property
    6060    def translated_state(self):
    61         return application_states_dict[self.app_state]
     61        return application_states_dict[self.state]
    6262
    6363    @property
     
    8484        """
    8585        # Is applicant in the correct state?
    86         if self.app_state != 'admitted':
     86        if self.state != 'admitted':
    8787            return False, "Applicant has not yet been admitted."
    8888        # Does registration number exist?
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8282 r8286  
    759759    @property
    760760    def display_actions(self):
    761         app_state = IWorkflowState(self.context).getState()
    762         if app_state == INITIALIZED:
     761        state = IWorkflowState(self.context).getState()
     762        if state == INITIALIZED:
    763763            actions = [[],[]]
    764         elif app_state == STARTED:
     764        elif state == STARTED:
    765765            actions = [[_('Save')],
    766766                [_('Add online payment ticket'),_('Remove selected tickets')]]
    767         elif app_state == PAID:
     767        elif state == PAID:
    768768            actions = [[_('Save'), _('Final Submit')],
    769769                [_('Remove selected tickets')]]
     
    773773
    774774    def unremovable(self, ticket):
    775         app_state = IWorkflowState(self.context).getState()
    776         return ticket.r_code or app_state in (INITIALIZED, SUBMITTED)
     775        state = IWorkflowState(self.context).getState()
     776        return ticket.r_code or state in (INITIALIZED, SUBMITTED)
    777777
    778778    def emit_lock_message(self):
     
    826826            return
    827827        self.applyData(self.context, **data)
    828         app_state = IWorkflowState(self.context).getState()
     828        state = IWorkflowState(self.context).getState()
    829829        # This shouldn't happen, but the application officer
    830830        # might have forgotten to lock the form after changing the state
    831         if app_state != PAID:
     831        if state != PAID:
    832832            self.flash(_('This form cannot be submitted. Wrong state!'))
    833833            return
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8282 r8286  
    306306
    307307    history = Attribute('Object history, a list of messages')
    308     app_state = Attribute('The application state of an applicant')
     308    state = Attribute('The application state of an applicant')
    309309    display_fullname = Attribute('The fullname of an applicant')
    310310    application_date = Attribute('Date of submission, used for export only')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py

    r8282 r8286  
    8181
    8282    def _addComments(self, data):
    83         if self.context.app_state == 'created':
     83        if self.context.state == 'created':
    8484            comment1 = _(
    8585                'Proceed to the login page of the portal' +
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8282 r8286  
    662662        self.assertMatches('...paid...',
    663663                           self.browser.contents)
    664         app_state = IWorkflowState(self.applicant).getState()
    665         self.assertTrue(app_state == 'paid')
     664        state = IWorkflowState(self.applicant).getState()
     665        self.assertTrue(state == 'paid')
    666666
    667667    def test_final_submit(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r8282 r8286  
    141141        # into two parts.
    142142        self.assertTrue(
    143             'app_state,applicant_id,application_date,application_number,course1,course2,'
     143            'applicant_id,application_date,application_number,course1,course2,'
    144144            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    145145            'history,lastname,locked,middlename,notice,password,phone,'
    146             'reg_number,screening_score,screening_venue,sex,'
     146            'reg_number,screening_score,screening_venue,sex,state,'
    147147            'student_id\r\n'
    148             'initialized,dp2011_654321,,654321,,,,,Anna Tester,,Anna,'
     148            'dp2011_654321,,654321,,,,,Anna Tester,,Anna,'
    149149            in result)
    150150        self.assertTrue(
    151151            'Application initialized by system\'],Tester,'
    152             '0,,,,,,,,,\r\n'
     152            '0,,,,,,,,,initialized,\r\n'
    153153            in result)
    154154        return
     
    164164        # history dict. We skip the date and split the comparison
    165165        # into two parts.
    166         print result
    167         self.assertTrue(
    168             'app_state,applicant_id,application_date,application_number,course1,course2,'
     166        self.assertTrue(
     167            'applicant_id,application_date,application_number,course1,course2,'
    169168            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    170169            'history,lastname,locked,middlename,notice,password,phone,'
    171             'reg_number,screening_score,screening_venue,sex,'
     170            'reg_number,screening_score,screening_venue,sex,state,'
    172171            'student_id\r\n'
    173             'initialized,dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
     172            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
    174173            'Anna M. Tester,anna@sample.com,Anna,'
    175174            in result)
     
    177176            'Application initialized by system\'],'
    178177            'Tester,0,M.,"Some notice\nin lines.",any password,'
    179             '+234-123-12345,123456,98,Exam Room,f,\r\n'
     178            '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n'
    180179            in result)
    181180
     
    190189        result = open(self.outfile, 'rb').read()
    191190        self.assertTrue(
    192             'app_state,applicant_id,application_date,application_number,course1,course2,'
     191            'applicant_id,application_date,application_number,course1,course2,'
    193192            'course_admitted,date_of_birth,display_fullname,email,firstname,'
    194193            'history,lastname,locked,middlename,notice,password,phone,'
    195             'reg_number,screening_score,screening_venue,sex,'
     194            'reg_number,screening_score,screening_venue,sex,state,'
    196195            'student_id\r\n'
    197             'initialized,dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
     196            'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04,'
    198197            'Anna M. Tester,anna@sample.com,Anna,'
    199198            in result)
     
    201200            'Application initialized by system\'],'
    202201            'Tester,0,M.,"Some notice\nin lines.",any password,'
    203             '+234-123-12345,123456,98,Exam Room,f,\r\n'
    204             in result)
    205         return
     202            '+234-123-12345,123456,98,Exam Room,f,initialized,\r\n'
     203            in result)
     204        return
Note: See TracChangeset for help on using the changeset viewer.