- Timestamp:
- 2 Jan 2010, 14:30:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/browser/pages.py
r4632 r4633 3 3 """ 4 4 import grok 5 from waeup.browser import WAeUPPage, WAeUPEditFormPage 5 from waeup.browser import WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage 6 6 from waeup.interfaces import (IUniversity, IWAeUPObject, IUserContainer, 7 7 IUserAccount) … … 129 129 self.flash('User %s successfully deleted.' % userid) 130 130 131 class AddUserFormPage(WAeUPAddFormPage): 132 grok.require('waeup.manageUsers') 133 grok.context(IUserContainer) 134 grok.name('add') 135 form_fields = grok.AutoFields(IUserAccount) 136 label = 'Add user' 137 title = 'Add user' 138 139 @grok.action('Add user') 140 def addUser(self, **data): 141 name = data['name'] 142 title = data['title'] 143 description = data['description'] 144 password = data['password'] 145 roles = data['roles'] 146 try: 147 self.context.addUser(name, password, title=title, 148 description=description, roles=roles) 149 except DuplicationError: 150 self.status = Invalid('The userid chosen already exists ' 151 'in the database') 152 return 153 self.redirect(self.url(self.context)) 154 131 155 class UserEditFormPage(WAeUPEditFormPage): 132 156 """Edit a user account.
Note: See TracChangeset for help on using the changeset viewer.