Changeset 6771 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 14 Sep 2011, 14:20:40 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6770 r6771 44 44 ob_class = view.__implemented__.__name__.replace('waeup.sirp.','') 45 45 changed_fields = view.applyData(view.context, **data) 46 changed_fields = changed_fields.values() 47 fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields) 46 # Turn list of lists into single list 47 if changed_fields: 48 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 49 fields_string = ' + '.join(changed_fields) 48 50 view.context._p_changed = True 49 51 view.flash('Form has been saved.') … … 335 337 IUserAccount(self.context).setPassword(form['password']) 336 338 self.context.loggerInfo(ob_class, 'password changed') 339 # Turn list of lists into single list 337 340 changed_fields = self.applyData(self.context, **data) 338 changed_fields = changed_fields.values() 339 fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields) 341 if changed_fields: 342 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 343 changed_fields = [x for x in changed_fields 344 if not x.startswith('password')] 345 fields_string = ' + '.join(changed_fields) 340 346 self.context._p_changed = True 341 347 if form.has_key('transition') and form['transition']: … … 587 593 @grok.action('Save', failure=onFailure) 588 594 def save(self, **data): 589 form = self.request.form 590 ob_class = self.__implemented__.__name__.replace('waeup.sirp.','') 591 changed_fields = self.applyData(self.context, **data) 592 # Turn list of lists into single list 593 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 594 changed_fields = [x for x in changed_fields 595 if not x.startswith('password')] 596 if form.get('form.password', u'') != u'': 597 self.context.loggerInfo(ob_class, 'password changed') 598 self.flash('Form has been saved.') 599 fields_string = ' + '.join(changed_fields) 600 if fields_string: 601 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) 595 self.applyData(self.context, **data) 596 self.flash('Form has been saved.') 602 597 return 603 598 … … 652 647 self.context.clr_code = pin 653 648 IWorkflowInfo(self.context).fireTransition('start_clearance') 654 self.flash('Clearance process isstarted.')649 self.flash('Clearance process has been started.') 655 650 self.redirect(self.url(self.context,'cedit')) 656 651 return … … 698 693 def save(self, **data): 699 694 self.applyData(self.context, **data) 700 self.flash(' Form has been saved.')695 self.flash('Clearance form has been saved.') 701 696 return 702 697 … … 708 703 # self.flash(self.dataNotComplete()) 709 704 # return 705 self.flash('Clearance form has been saved.') 710 706 self.redirect(self.url(self.context,'request_clearance')) 711 707 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6769 r6771 122 122 123 123 adm_code = schema.TextLine( 124 title = u'PWD access code',124 title = u'PWD Access Code', 125 125 default = u'', 126 126 required = False, … … 143 143 144 144 clr_code = schema.TextLine( 145 title = u'CLR access code',145 title = u'CLR Access Code', 146 146 default = u'', 147 147 required = False, -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6769 r6771 402 402 self.browser.getControl(name="ac_number").value = self.existing_clrnumber 403 403 self.browser.getControl("Start clearance now").click() 404 self.assertMatches('...Clearance process isstarted...',404 self.assertMatches('...Clearance process has been started...', 405 405 self.browser.contents) 406 406 self.browser.getControl(name="form.date_of_birth").value = '09/10/1961'
Note: See TracChangeset for help on using the changeset viewer.