Changeset 12349 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 31 Dec 2014, 11:08:41 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12348 r12349 38 38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, 39 39 IPasswordValidator, IUserAccount, 40 VERIFIED, REJECTED, EXPIRED, APPROVED)40 VERIFIED, REJECTED, EXPIRED, REQUESTED, APPROVED) 41 41 from waeup.ikoba.browser.layout import ( 42 42 IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage, … … 678 678 grok.name('edit_base') 679 679 grok.require('waeup.handleCustomer') 680 form_fields = grok.AutoFields(ICustomer).select(681 'email', 'phone')682 680 label = _('Edit base data') 683 681 pnav = 4 682 683 @property 684 def form_fields(self): 685 if self.context.state in (REQUESTED, APPROVED): 686 return grok.AutoFields(ICustomer).select('email', 'phone') 687 return grok.AutoFields(ICustomer).omit( 688 'suspended', 'suspended_comment', 'reg_number', 'customer_id') 684 689 685 690 @action(_('Save'), style='primary') 686 691 def save(self, **data): 687 692 msave(self, **data) 693 return 694 695 def is_editable(self, action): 696 if self.context.state in (REQUESTED, APPROVED): 697 return False 698 return True 699 700 @action(_('Request registration now'), warning=WARNING, condition=is_editable) 701 def finalsubmit(self, **data): 702 msave(self, **data) 703 IWorkflowInfo(self.context).fireTransition('request') 704 self.flash(_('Registration form has been submitted.')) 705 self.redirect(self.url(self.context)) 688 706 return 689 707
Note: See TracChangeset for help on using the changeset viewer.