Beispiel #1
0
 def process_add(self, **kwargs):
     form = OperatorAddForm(request_params())
     form.access_id.choices = [(l.id, l.description) for l in access.list()]
     if form.validate():
         operator = operators.create(username=form.username.data,
                                     password=form.password.data,
                                     access_id=form.access_id.data)
         auditlog.log(auditlog.CODE_CONTENT_ADD, target=operator)
         notify_entity_activity(operator, 'created')
         raise cherrypy.HTTPRedirect('/user/list')
     else:
         return render('user/add.html', {'form': form })