Changeset 14822 for main/waeup.aaue/trunk
- Timestamp:
- 30 Aug 2017, 10:33:33 (7 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py
r14696 r14822 391 391 @property 392 392 def display_actions(self): 393 state = IWorkflowState(self.context).getState()394 393 # If the form is unlocked, applicants are allowed to save the form 395 394 # and remove unused tickets. 396 395 actions = [[_('Save')], []] 397 396 # Only in state started they can also add tickets. 398 if s tate == STARTED:397 if self.context.state == STARTED: 399 398 actions = [[_('Save')], 400 399 [_('Add online payment ticket')]] 401 400 # In state paid, they can submit the data and further add tickets 402 401 # if the application is special. 403 elif self.context.special and s tate == PAID:402 elif self.context.special and self.context.state == PAID: 404 403 actions = [[_('Save'), _('Finally Submit')], 405 404 [_('Add online payment ticket')]] 406 elif s tate == PAID:405 elif self.context.state == PAID: 407 406 actions = [[_('Save'), _('Finally Submit')], []] 408 407 return actions … … 494 493 grok.template('applicantcheckstatus') 495 494 496 class PaymentReceiptActionButton(ManageActionButton):495 class ScreeningInvitationActionButton(ManageActionButton): 497 496 grok.order(8) # This button should always be the last one. 498 497 grok.context(ICustomApplicant) … … 505 504 @property 506 505 def target_url(self): 507 if not self.context.screening_date: 506 if not self.context.screening_date or not self.context.state in ( 507 'submitted', 'admitted', 'paid', 'created'): 508 508 return '' 509 509 return self.view.url(self.view.context, self.target) … … 563 563 564 564 def update(self): 565 if not self.context.screening_date: 565 if not self.context.screening_date or not self.context.state in ( 566 'submitted', 'admitted', 'paid', 'created'): 566 567 self.flash(_('Forbidden'), type="warning") 567 568 self.redirect(self.url(self.context)) -
main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py
r14579 r14822 86 86 self.applicant.firstname = u'Jo' 87 87 self.applicant.email = 'xx@yy.zz' 88 self.browser.open(self.view_path) 89 self.assertFalse("Download application slip" in self.browser.contents) 90 IWorkflowState(self.applicant).setState('paid') 88 91 self.browser.open(self.view_path) 89 92 self.browser.getLink("screening invitation").click()
Note: See TracChangeset for help on using the changeset viewer.