Changeset 9900 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 17 Jan 2013, 13:03:55 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r9795 r9900 34 34 IApplicantRegisterUpdate 35 35 ) 36 from waeup.kofa.applicants.container import ApplicantsContainer 36 37 from waeup.kofa.applicants.applicant import search 37 38 from waeup.kofa.applicants.workflow import ( … … 578 579 be provided and only PortalManagers can do this. 579 580 """ 580 grok.context(IApplicantsContainer)581 #grok.context(IApplicantsContainer) 581 582 grok.name('createallstudents') 582 583 grok.require('waeup.managePortal') … … 586 587 results = list(cat.searchResults(state=(ADMITTED, ADMITTED))) 587 588 created = [] 589 container_only = False 590 applicants_root = grok.getSite()['applicants'] 591 if isinstance(self.context, ApplicantsContainer): 592 container_only = True 588 593 for result in results: 589 if result.__parent__ is not self.context:594 if container_only and result.__parent__ is not self.context: 590 595 continue 591 596 success, msg = result.createStudent(view=self) … … 594 599 else: 595 600 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 596 self.context.__parent__.logger.info(601 applicants_root.logger.info( 597 602 '%s - %s - %s' % (ob_class, result.applicant_id, msg)) 598 603 if len(created): … … 601 606 else: 602 607 self.flash(_('No student could be created.')) 603 self.redirect(self.url(self.context , u'statistics'))608 self.redirect(self.url(self.context)) 604 609 return 605 610 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
r9544 r9900 144 144 self.assertTrue('1 students successfully created' in self.browser.contents) 145 145 146 def test_hidden_batch_copying (self):146 def test_hidden_batch_copying_container(self): 147 147 logfile = os.path.join( 148 148 self.app['datacenter'].storage, 'logs', 'applicants.log') … … 171 171 self.assertTrue('1 students successfully created' in self.browser.contents) 172 172 173 def test_hidden_batch_copying_all(self): 174 logfile = os.path.join( 175 self.app['datacenter'].storage, 'logs', 'applicants.log') 176 self.prepare_applicant() 177 self.browser.open(self.manage_path) 178 self.browser.getControl(name="form.date_of_birth").value = '09/09/1988' 179 #self.browser.getControl(name="form.course_admitted").value = ['CERT1'] 180 self.browser.getControl("Save").click() 181 IWorkflowState(self.applicant).setState('admitted') 182 notify(grok.ObjectModifiedEvent(self.applicant)) 183 self.browser.open(self.root_path + '/createallstudents') 184 self.assertTrue('No student could be created' in self.browser.contents) 185 logcontent = open(logfile).read() 186 self.assertTrue('No course admitted provided' in logcontent) 187 self.applicant.course_admitted = self.certificate 188 self.browser.open(self.root_path + '/createallstudents') 189 self.assertTrue('1 students successfully created' in self.browser.contents) 190 173 191 def test_copier_wo_passport(self): 174 192 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r9759 r9900 139 139 140 140 class AllStudentsCreateActionButton(ManageActionButton): 141 grok.order( 1)142 grok.context(IApplicants Container)143 grok.view(Applicants StatisticsPage)141 grok.order(3) 142 grok.context(IApplicantsRoot) 143 grok.view(ApplicantsRootPage) 144 144 grok.require('waeup.managePortal') 145 145 icon = 'actionicon_entrance.png' 146 146 text = _('Create all student records') 147 147 target ='createallstudents' 148 149 class ContainerStudentsCreateActionButton(AllStudentsCreateActionButton): 150 grok.context(IApplicantsContainer) 151 grok.order(1) 152 grok.view(ApplicantsStatisticsPage) 148 153 149 154 class ApplicantViewActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.